Files
ports/databases/postgresql/pkg/postgresql.rc
T

34 lines
671 B
Bash
Raw Normal View History

#!/bin/ksh
2010-11-08 14:12:24 +00:00
daemon="${TRUEPREFIX}/bin/pg_ctl"
daemon_flags="-D /var/postgresql/data -w -l /var/postgresql/logfile"
2010-12-13 16:14:38 +00:00
daemon_user="_postgresql"
2021-11-07 14:27:44 +00:00
daemon_timeout=300
2010-12-13 16:14:38 +00:00
2010-12-27 14:50:22 +00:00
. /etc/rc.d/rc.subr
2010-12-24 10:40:04 +00:00
2012-08-04 15:28:14 +00:00
rc_usercheck=NO
2010-11-08 14:12:24 +00:00
# rc_exec is used because
# pg_ctl: cannot be run as root
# Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
rc_check() {
rc_exec "${daemon} status ${daemon_flags}"
}
rc_reload() {
rc_exec "${daemon} reload ${daemon_flags}"
}
2010-11-08 14:12:24 +00:00
rc_start() {
rc_exec "${daemon} start ${daemon_flags}"
2010-11-08 14:12:24 +00:00
}
rc_stop() {
rc_exec "${daemon} stop ${daemon_flags} -m fast" || \
rc_exec "${daemon} stop ${daemon_flags} -m immediate"
2010-11-08 14:12:24 +00:00
}
rc_cmd $1