2010-11-08 09:12:24 -05:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2012-08-04 11:28:14 -04:00
|
|
|
# $OpenBSD: postgresql.rc,v 1.10 2012/08/04 15:28:14 ajacoutot Exp $
|
|
|
|
|
|
|
|
datadir="/var/postgresql/data"
|
2010-11-08 09:12:24 -05:00
|
|
|
|
2012-06-01 11:06:45 -04:00
|
|
|
daemon="${TRUEPREFIX}/bin/pg_ctl"
|
|
|
|
daemon_flags="-l /var/postgresql/logfile"
|
2010-12-13 11:14:38 -05:00
|
|
|
daemon_user="_postgresql"
|
|
|
|
|
2010-12-27 09:50:22 -05:00
|
|
|
. /etc/rc.d/rc.subr
|
2010-12-24 05:40:04 -05:00
|
|
|
|
2012-08-04 11:28:14 -04:00
|
|
|
rc_usercheck=NO
|
2010-11-08 09:12:24 -05:00
|
|
|
|
2012-06-01 11:06:45 -04:00
|
|
|
rc_check() {
|
|
|
|
${rcexec} "${daemon} -D ${datadir} status"
|
|
|
|
}
|
|
|
|
|
|
|
|
rc_reload() {
|
|
|
|
${rcexec} "${daemon} -D ${datadir} reload"
|
|
|
|
}
|
|
|
|
|
2010-11-08 09:12:24 -05:00
|
|
|
rc_start() {
|
2010-12-15 06:32:26 -05:00
|
|
|
rm -f ${datadir}/postmaster.pid
|
2012-06-01 11:06:45 -04:00
|
|
|
${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}"
|
2010-11-08 09:12:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
rc_stop() {
|
2012-06-01 11:06:45 -04:00
|
|
|
${rcexec} "${daemon} -D ${datadir} stop -m fast" || \
|
|
|
|
${rcexec} "${daemon} -D ${datadir} stop -m immediate"
|
2010-11-08 09:12:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
rc_cmd $1
|