Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include states in run-postgresql #160

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions 9.4/root/usr/bin/run-postgresql
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@ check_env_vars
generate_passwd_file
generate_postgresql_config

if [ ! -f "$PGDATA/postgresql.conf" ]; then
if [ ! -f "$PGDATA/status/1.initialize_database_done" ]; then
find $PGDATA -mindepth 1 -delete
initialize_database
NEED_TO_CREATE_USERS=yes
mkdir -p $PGDATA/status/
touch $PGDATA/status/1.initialize_database_done
fi

pg_ctl -w start -o "-h ''"
if [ "${NEED_TO_CREATE_USERS:-}" == "yes" ]; then
if [ ! -f "$PGDATA/status/2.create_users_done" ]; then
create_users
touch $PGDATA/status/2.create_users_done
fi
if [ ! -f "$PGDATA/status/3.set_passwords_done" ]; then
set_passwords
touch $PGDATA/status/3.set_passwords_done
fi
set_passwords
pg_ctl stop

unset_env_vars
Expand Down