From e6ae389297bbc3d5f7692db9ae7f5d147b0dc204 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 19 Feb 2023 19:38:48 +0100 Subject: [PATCH] postgresql: moar regenconf fixes --- hooks/conf_regen/35-postgresql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/conf_regen/35-postgresql b/hooks/conf_regen/35-postgresql index 1cf8e6d99..3a3843d69 100755 --- a/hooks/conf_regen/35-postgresql +++ b/hooks/conf_regen/35-postgresql @@ -20,7 +20,7 @@ do_pre_regen() { } do_post_regen() { - regen_conf_files=$1 + #regen_conf_files=$1 # Make sure postgresql is started and enabled # (N.B. : to check the active state, we check the cluster state because @@ -34,6 +34,8 @@ do_post_regen() { if [ ! -f "$PSQL_ROOT_PWD_FILE" ] || [ -z "$(cat $PSQL_ROOT_PWD_FILE)" ]; then ynh_string_random >$PSQL_ROOT_PWD_FILE fi + + [ ! -e $PSQL_ROOT_PWD_FILE ] || { chown root:postgres $PSQL_ROOT_PWD_FILE; chmod 440 $PSQL_ROOT_PWD_FILE; } sudo --login --user=postgres psql -c"ALTER user postgres WITH PASSWORD '$(cat $PSQL_ROOT_PWD_FILE)'" postgres