allow preinit scripts to place signal files (#326)
This commit is contained in:
parent
ebc4f8eacd
commit
ad00d29ec0
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue