1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-29 21:39:24 +00:00
freebsd-ports/databases/postgresql84-server/files/pgsql.sh.tmpl
Jimmy Olgeni 785d876b22 Cosmetic changes for the shutdown procedure.
* Pass the -s option to pg_ctl, to avoid clobbering the display.
  It will show error messages only.

* Echo the port name after shutdown.

No functional changes, no PORTREVISION.
2001-05-02 11:44:38 +00:00

37 lines
759 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 \
'[ -d ${PGDATA} ] && exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl start -s -w -l ~pgsql/errlog'
echo -n ' pgsql'
}
;;
stop)
[ -x ${PGBIN}/pg_ctl ] && {
su -l pgsql -c 'exec %%PREFIX%%/%%PG_PREFIX%%bin/pg_ctl stop -s -m fast'
echo -n ' pgsql'
}
;;
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