#!/bin/sh # # $NetBSD: pgsql.sh.tmpl,v 1.8 2000/09/21 14:34:56 jlam Exp $ # FreeBSD Id: pgsql.sh.tmpl,v 1.3 1997/10/05 21:00:49 andreas Exp # # pgsql.sh - postgresql startup file for NetBSD # # PROVIDE: pgsql # REQUIRE: DAEMON CMD=${1:-start} USER=@PGUSER@ if [ -x @PREFIX@/bin/postmaster -a -x @PREFIX@/bin/pg_ctl ] then case ${CMD} in start) echo -n ' pgsql' su -l ${USER} -c 'exec @PREFIX@/bin/pg_ctl \ -p @PREFIX@/bin/postmaster -o "-S -o -F" start \ > @PGHOME@/errlog' ;; stop) su -l ${USER} -c 'exec @PREFIX@/bin/pg_ctl stop \ >> @PGHOME@/errlog' ;; restart) su -l ${USER} -c 'exec @PREFIX@/bin/pg_ctl restart \ >> @PGHOME@/errlog' ;; status) su -l ${USER} -c 'exec @PREFIX@/bin/pg_ctl status' ;; *) echo "Unexpected argument: ${CMD}" ;; esac fi