openbsd-ports/databases/postgresql/pkg/postgresql.rc

30 lines
515 B
Bash

#!/bin/ksh
daemon="${TRUEPREFIX}/bin/pg_ctl"
daemon_flags="-D /var/postgresql/data -w -l /var/postgresql/logfile"
daemon_user="_postgresql"
daemon_timeout=300
. /etc/rc.d/rc.subr
rc_usercheck=NO
rc_check() {
rc_exec "${daemon} status ${daemon_flags}"
}
rc_reload() {
rc_exec "${daemon} reload ${daemon_flags}"
}
rc_start() {
rc_exec "${daemon} start ${daemon_flags}"
}
rc_stop() {
rc_exec "${daemon} stop ${daemon_flags} -m fast" || \
rc_exec "${daemon} stop ${daemon_flags} -m immediate"
}
rc_cmd $1