From 553fdbb0c5a0d3e739bf9075234162fb9162a5b5 Mon Sep 17 00:00:00 2001 From: Pavel Syromiatnikov Date: Thu, 8 May 2025 13:14:34 +0300 Subject: [PATCH 1/2] fix server.key permission error --- .../src/operator/src/main/resources/templates/start-patroni.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh b/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh index 2fd971410..559778f17 100644 --- a/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh +++ b/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh @@ -374,7 +374,7 @@ mv "$PATRONI_CONFIG_FILE_PATH".tmp "$PATRONI_CONFIG_FILE_PATH" cat << EOF > "${LOCAL_BIN_PATH}/postgres" #!/bin/sh -chmod 700 "$PG_DATA_PATH" +chmod -R 700 "$PG_DATA_PATH" exec "$PG_BIN_PATH/postgres" "\$@" EOF chmod 755 "${LOCAL_BIN_PATH}/postgres" From 6c1908baa1d6dba54d9beaf8ba82bf384d9a7bc4 Mon Sep 17 00:00:00 2001 From: Pavel Syromiatnikov Date: Thu, 8 May 2025 14:05:35 +0300 Subject: [PATCH 2/2] selective fix for permission error after pod re-init --- .../src/operator/src/main/resources/templates/start-patroni.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh b/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh index 559778f17..3a0c7b43b 100644 --- a/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh +++ b/stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh @@ -374,7 +374,8 @@ mv "$PATRONI_CONFIG_FILE_PATH".tmp "$PATRONI_CONFIG_FILE_PATH" cat << EOF > "${LOCAL_BIN_PATH}/postgres" #!/bin/sh -chmod -R 700 "$PG_DATA_PATH" +chmod 700 "$PG_DATA_PATH" +chmod 700 "${PG_DATA_PATH}/server.key" # fix private key file server.key has group or world access error exec "$PG_BIN_PATH/postgres" "\$@" EOF chmod 755 "${LOCAL_BIN_PATH}/postgres"