2018-01-11 19:27:01 +00:00
|
|
|
#!/bin/ksh
|
2010-11-08 14:12:24 +00:00
|
|
|
|
2012-06-01 15:06:45 +00:00
|
|
|
daemon="${TRUEPREFIX}/bin/pg_ctl"
|
2019-08-27 19:49:46 +00:00
|
|
|
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
|
|
|
|
2022-05-21 15:36:16 +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.
|
|
|
|
|
|
2012-06-01 15:06:45 +00:00
|
|
|
rc_check() {
|
2022-05-21 10:50:49 +00:00
|
|
|
rc_exec "${daemon} status ${daemon_flags}"
|
2012-06-01 15:06:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rc_reload() {
|
2022-05-21 10:50:49 +00:00
|
|
|
rc_exec "${daemon} reload ${daemon_flags}"
|
2012-06-01 15:06:45 +00:00
|
|
|
}
|
|
|
|
|
|
2010-11-08 14:12:24 +00:00
|
|
|
rc_start() {
|
2022-05-21 10:50:49 +00:00
|
|
|
rc_exec "${daemon} start ${daemon_flags}"
|
2010-11-08 14:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rc_stop() {
|
2022-05-21 10:50:49 +00:00
|
|
|
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
|