Fix nbtree "deduce NOT NULL" scan key comment.
[pgsql.git] / contrib / start-scripts / freebsd
blobed4f9ba620350f842e7e7a4aa6123e44ab491ec4
1 #! /bin/sh
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 # contrib/start-scripts/freebsd
11 ## EDIT FROM HERE
13 # Installation prefix
14 prefix=/usr/local/pgsql
16 # Data directory
17 PGDATA="/usr/local/pgsql/data"
19 # Who to run postgres as, usually "postgres". (NOT "root")
20 PGUSER=postgres
22 # Where to keep a log file
23 PGLOG="$PGDATA/serverlog"
25 ## STOP EDITING HERE
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 postgres. (If you want the script to wait
31 # until the server has started, you could use "pg_ctl start" here.)
32 DAEMON="$prefix/bin/postgres"
34 # What to use to shut down postgres
35 PGCTL="$prefix/bin/pg_ctl"
37 # Only start if we can find postgres.
38 test -x $DAEMON ||
40 echo "$DAEMON not found"
41 exit 0
44 case $1 in
45 start)
46 su -l $PGUSER -c "$DAEMON -D '$PGDATA' >>$PGLOG 2>&1 &"
47 echo -n ' postgresql'
49 stop)
50 su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
52 restart)
53 su -l $PGUSER -c "$PGCTL stop -D '$PGDATA' -s"
54 su -l $PGUSER -c "$DAEMON -D '$PGDATA' >>$PGLOG 2>&1 &"
56 status)
57 su -l $PGUSER -c "$PGCTL status -D '$PGDATA'"
60 # Print help
61 echo "Usage: `basename $0` {start|stop|restart|status}" 1>&2
62 exit 1
64 esac
66 exit 0