| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# PostgreSQL server start script (launched by org.postgresql.postgres.plist) |
| 4 |
|
| 5 |
# edit these as needed: |
| 6 |
|
| 7 |
# directory containing postgres executable: |
| 8 |
PGBINDIR="/usr/local/pgsql/bin" |
| 9 |
# data directory: |
| 10 |
PGDATA="/usr/local/pgsql/data" |
| 11 |
# file to receive postmaster's initial log messages: |
| 12 |
PGLOGFILE="${PGDATA}/pgstart.log" |
| 13 |
|
| 14 |
# (it's recommendable to enable the Postgres logging_collector feature |
| 15 |
# so that PGLOGFILE doesn't grow without bound) |
| 16 |
|
| 17 |
|
| 18 |
# set umask to ensure PGLOGFILE is not created world-readable |
| 19 |
umask 077 |
| 20 |
|
| 21 |
# wait for networking to be up (else server may not bind to desired ports) |
| 22 |
/usr/sbin/ipconfig waitall |
| 23 |
|
| 24 |
# and launch the server |
| 25 |
exec "$PGBINDIR"/postgres -D "$PGDATA" >>"$PGLOGFILE" 2>&1 |