postgresql.rc 619 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # $OpenBSD: postgresql.rc,v 1.11 2014/09/23 08:41:10 sthen Exp $
  4. datadir="/var/postgresql/data"
  5. daemon="${TRUEPREFIX}/bin/pg_ctl"
  6. daemon_flags="-w -l /var/postgresql/logfile"
  7. daemon_user="_postgresql"
  8. . /etc/rc.d/rc.subr
  9. rc_usercheck=NO
  10. rc_check() {
  11. ${rcexec} "${daemon} -D ${datadir} status"
  12. }
  13. rc_reload() {
  14. ${rcexec} "${daemon} -D ${datadir} reload"
  15. }
  16. rc_start() {
  17. rm -f ${datadir}/postmaster.pid
  18. ${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}"
  19. }
  20. rc_stop() {
  21. ${rcexec} "${daemon} -D ${datadir} stop -m fast" || \
  22. ${rcexec} "${daemon} -D ${datadir} stop -m immediate"
  23. }
  24. rc_cmd $1