Pull changes from upstream repository
This commit is contained in:
parent
228023ff21
commit
f409f0a74f
46 changed files with 5661 additions and 0 deletions
47
root/usr/bin/run-postgresql
Executable file
47
root/usr/bin/run-postgresql
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
|
||||
export ENABLE_REPLICATION=${ENABLE_REPLICATION:-false}
|
||||
|
||||
set -eu
|
||||
export_vars=$(cgroup-limits) ; export $export_vars
|
||||
|
||||
source "${CONTAINER_SCRIPTS_PATH}/common.sh"
|
||||
|
||||
set_pgdata
|
||||
|
||||
process_extending_files \
|
||||
"${APP_DATA}/src/postgresql-pre-start" \
|
||||
"${CONTAINER_SCRIPTS_PATH}/pre-start"
|
||||
|
||||
check_env_vars
|
||||
generate_passwd_file
|
||||
generate_postgresql_config
|
||||
|
||||
# Is this brand new data volume?
|
||||
PG_INITIALIZED=false
|
||||
|
||||
if [ ! -f "$PGDATA/postgresql.conf" ]; then
|
||||
initialize_database
|
||||
PG_INITIALIZED=:
|
||||
else
|
||||
try_pgupgrade
|
||||
fi
|
||||
|
||||
pg_ctl -w start -o "-h ''"
|
||||
if $PG_INITIALIZED ; then
|
||||
process_extending_files \
|
||||
"${APP_DATA}/src/postgresql-init" \
|
||||
"${CONTAINER_SCRIPTS_PATH}/init"
|
||||
migrate_db
|
||||
create_users
|
||||
fi
|
||||
|
||||
process_extending_files \
|
||||
"${APP_DATA}/src/postgresql-start" \
|
||||
"${CONTAINER_SCRIPTS_PATH}/start"
|
||||
|
||||
pg_ctl stop
|
||||
|
||||
unset_env_vars
|
||||
echo "Starting server..."
|
||||
exec postgres "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue