allow preinit scripts to place signal files (#326)

This commit is contained in:
Mark Havekes 2022-02-22 16:12:39 +01:00 committed by GitHub
parent ebc4f8eacd
commit ad00d29ec0
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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