freebsd-ports/databases/postgresql-devel/files/pgsql.sh.tmpl
Vanilla I. Shu bfb9f8e6c9 Upgrade to 7.1, change to new layout style.
PR:				ports/26741
Submitted by:	maintainer
2001-04-21 11:34:34 +00:00

35 lines
720 B
Bash

#!/bin/sh
# $FreeBSD$
#
# For postmaster startup options, edit $PGDATA/postgresql.conf
PGBIN=%%PREFIX%%/%%PG_PREFIX%%bin
case $1 in
start)
[ -d %%PREFIX%%/%%PG_PREFIX%%lib ] && /sbin/ldconfig -m %%PREFIX%%/%%PG_PREFIX%%lib
[ -x ${PGBIN}/pg_ctl ] && {
su -l pgsql -c \
'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl start -w -l ~pgsql/errlog'
echo -n ' pgsql'
}
;;
stop)
[ -x ${PGBIN}/pg_ctl ] && {
exec su -l pgsql -c 'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl stop -m fast'
}
;;
status)
[ -x ${PGBIN}/pg_ctl ] && {
exec su -l pgsql -c 'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl status'
}
;;
*)
echo "usage: `basename $0` {start|stop|status}" >&2
exit 64
;;
esac