34 lines
620 B
Bash
34 lines
620 B
Bash
#!/bin/sh
|
|
#
|
|
# $OpenBSD: postgresql.rc,v 1.10 2012/08/04 15:28:14 ajacoutot Exp $
|
|
|
|
datadir="/var/postgresql/data"
|
|
|
|
daemon="${TRUEPREFIX}/bin/pg_ctl"
|
|
daemon_flags="-l /var/postgresql/logfile"
|
|
daemon_user="_postgresql"
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
rc_usercheck=NO
|
|
|
|
rc_check() {
|
|
${rcexec} "${daemon} -D ${datadir} status"
|
|
}
|
|
|
|
rc_reload() {
|
|
${rcexec} "${daemon} -D ${datadir} reload"
|
|
}
|
|
|
|
rc_start() {
|
|
rm -f ${datadir}/postmaster.pid
|
|
${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}"
|
|
}
|
|
|
|
rc_stop() {
|
|
${rcexec} "${daemon} -D ${datadir} stop -m fast" || \
|
|
${rcexec} "${daemon} -D ${datadir} stop -m immediate"
|
|
}
|
|
|
|
rc_cmd $1
|