From ad00d29ec040f53502f218952d459cc6ae5f3d0f Mon Sep 17 00:00:00 2001 From: Mark Havekes Date: Tue, 22 Feb 2022 16:12:39 +0100 Subject: [PATCH] allow preinit scripts to place signal files (#326) --- .../14/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh | 2 -- .../14/debian-10/rootfs/opt/bitnami/scripts/postgresql/setup.sh | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh index 9fea03c2f007..37216cf67c66 100644 --- a/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -567,8 +567,6 @@ postgresql_clean_from_restart() { ######################### postgresql_initialize() { info "Initializing PostgreSQL database..." - postgresql_clean_from_restart - # This fixes an issue where the trap would kill the entrypoint.sh, if a PID was left over from a previous run # Exec replaces the process without creating a new one, and when the container is restarted it may have the same PID rm -f "$POSTGRESQL_PID_FILE" diff --git a/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/postgresql/setup.sh b/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/postgresql/setup.sh index d1d6702e020a..c88cb0dc6b18 100755 --- a/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/postgresql/setup.sh +++ b/bitnami/postgresql/14/debian-10/rootfs/opt/bitnami/scripts/postgresql/setup.sh @@ -25,6 +25,8 @@ trap "postgresql_stop" EXIT am_i_root && ensure_user_exists "$POSTGRESQL_DAEMON_USER" --group "$POSTGRESQL_DAEMON_GROUP" # Fix logging issue when running as root am_i_root && chmod o+w "$(readlink /dev/stdout)" +# Remove flags and postmaster files from a previous run +postgresql_clean_from_restart # Allow running custom pre-initialization scripts postgresql_custom_pre_init_scripts # Ensure PostgreSQL is initialized