freebsd-ports/databases/postgresql74-server/files/pgsql.sh.tmpl
Jimmy Olgeni a3b8729fbc Misc. changes and cleanups.
* Move the call to configure.postgresql7 from pre-fetch to pre-extract, so it
won't hang while performing batch fetch operations (like portupgrade -F)

* Add some TCL related files to pkg-plist.tcl, and add a PLIST_SUB in the
Makefile to register the correct tcl version in the plist.

* Do not start postgresql if the database directory does not exist: the
startup sequence could hang because of this.

* Use the "-s" option when starting postgresql with pg_ctl, so it won't
display informational messages. Display only the port name, as do other
packages startup scripts.

Approved by:	Palle Girgensohn <girgen@partitur.se>
2001-04-25 17:17:56 +00:00

36 lines
743 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 ] && {
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