14 lines
650 B
Bash
14 lines
650 B
Bash
#!/bin/bash
|
|
|
|
# Init and start the postgres daemon
|
|
initdb --no-locale
|
|
pg_ctl start -w -o "-c listen_addresses=0.0.0.0 -c unix_socket_permissions=0700 -c max_connections=9990 -c shared_preload_libraries=pg_stat_statements -c session_preload_libraries=auto_explain -c auto_explain.log_min_duration=100ms" # COPY postgresql.conf and postgres_hba.conf resulted in error (Invalid data directory)
|
|
POSTGRID=`cat /var/lib/postgresql/data/postmaster.pid | perl -le '<>=~m#(\d+)# and print $1'`
|
|
|
|
# Create uniworx and uniworx_test database
|
|
psql -f /schema.sql postgres
|
|
|
|
# Wait for postgres daemon to terminate
|
|
while [ -e /proc/$POSTGRID ]; do
|
|
sleep 0.5;
|
|
done |