#!/bin/sh # $FreeBSD: ports/databases/postgresql7/files/pgsql.sh.tmpl,v 1.12 2001/05/02 11:44:38 olgeni Exp $ # # For postmaster startup options, edit $PGDATA/postgresql.conf PGBIN=/usr/local/bin case $1 in start) [ -d /usr/local/lib ] && /sbin/ldconfig -m /usr/local/lib [ -x ${PGBIN}/pg_ctl ] && { su -l postgres -c \ '[ -d /usr/local/pgsql/data ] && exec /usr/local/bin/pg_ctl start -D /usr/local/pgsql/data -s -w -l ~pgsql/errlog' echo -n ' postgres' } ;; stop) [ -x ${PGBIN}/pg_ctl ] && { su -l postgres -c 'exec /usr/local/bin/pg_ctl stop -s -m fast -D /usr/local/pgsql/data' echo -n ' postgres' } ;; status) [ -x ${PGBIN}/pg_ctl ] && { exec su -l postgres -c 'exec /usr/local/bin/pg_ctl status -D /usr/local/pgsql/data' } ;; *) echo "usage: `basename $0` {start|stop|status}" >&2 exit 64 ;; esac