]> granicus.if.org Git - postgresql/blob - contrib/start-scripts/freebsd
Typo fix in comment from David Wheeler
[postgresql] / contrib / start-scripts / freebsd
1 #! /bin/sh
2
3 # PostgreSQL boot time startup script for FreeBSD.  Copy this file to
4 # /usr/local/etc/rc.d/postgresql.
5
6 # Created through merger of the Linux start script by Ryan Kirkpatrick
7 # and the script in the FreeBSD ports collection.
8
9 # $Header: /cvsroot/pgsql/contrib/start-scripts/freebsd,v 1.2 2001/04/19 19:17:44 petere Exp $
10
11 ## EDIT FROM HERE
12
13 # Installation prefix
14 prefix=/usr/local/pgsql
15
16 # Data directory
17 PGDATA="/usr/local/pgsql/data"
18
19 # Who to run pg_ctl as, should be "postgres".
20 PGUSER=postgres
21
22 # Where to keep a log file
23 PGLOG="$PGDATA/serverlog"
24
25 ## STOP EDITING HERE
26
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
29
30 # What to use to start up the postmaster
31 DAEMON="$prefix/bin/pg_ctl"
32
33 test -x "$DAEMON" || exit 0
34
35 case $1 in
36     start)
37         su -l $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG"
38         echo -n ' postgresql'
39         ;;
40     stop)
41         su -l $PGUSER -c "$DAEMON stop -D '$PGDATA' -s -m fast"
42         ;;
43     restart)
44         su -l $PGUSER -c "$DAEMON restart -D '$PGDATA' -s -m fast"
45         ;;
46     status)
47         su -l $PGUSER -c "$DAEMON status -D '$PGDATA'"
48         ;;
49     *)
50         # Print help
51         echo "Usage: `basename $0` {start|stop|restart|status}" 1>&2
52         exit 1
53         ;;
54 esac
55
56 exit 0