3 # PostgreSQL boot time startup script for FreeBSD. Copy this file to
4 # /usr/local/etc/rc.d/postgresql.
6 # Created through merger of the Linux start script by Ryan Kirkpatrick
7 # and the script in the FreeBSD ports collection.
9 # $Header: /cvsroot/pgsql/contrib/start-scripts/freebsd,v 1.2 2001/04/19 19:17:44 petere Exp $
14 prefix=/usr/local/pgsql
17 PGDATA="/usr/local/pgsql/data"
19 # Who to run pg_ctl as, should be "postgres".
22 # Where to keep a log file
23 PGLOG="$PGDATA/serverlog"
27 # The path that is to be used for the script
28 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 # What to use to start up the postmaster
31 DAEMON="$prefix/bin/pg_ctl"
33 test -x "$DAEMON" || exit 0
37 su -l $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG"
41 su -l $PGUSER -c "$DAEMON stop -D '$PGDATA' -s -m fast"
44 su -l $PGUSER -c "$DAEMON restart -D '$PGDATA' -s -m fast"
47 su -l $PGUSER -c "$DAEMON status -D '$PGDATA'"
51 echo "Usage: `basename $0` {start|stop|restart|status}" 1>&2