initial commit

Starting from here (9.5 subtree):
2f9f70c98e
This commit is contained in:
Pavel Raiskup 2017-04-06 09:15:35 +02:00
commit 777c76868d
16 changed files with 980 additions and 0 deletions

28
root/usr/bin/run-postgresql Executable file
View file

@ -0,0 +1,28 @@
#!/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
check_env_vars
generate_passwd_file
generate_postgresql_config
if [ ! -f "$PGDATA/postgresql.conf" ]; then
initialize_database
NEED_TO_CREATE_USERS=yes
fi
pg_ctl -w start -o "-h ''"
if [ "${NEED_TO_CREATE_USERS:-}" == "yes" ]; then
create_users
fi
set_passwords
pg_ctl stop
unset_env_vars
exec postgres "$@"