newbsd-init.in 660 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016 Nagios(R) Core(TM) Development Team
  4. #
  5. # PROVIDE: nrpe
  6. # REQUIRE: DAEMON
  7. # KEYWORD: shutdown
  8. . /etc/rc.subr
  9. : ${nrpe@bsd_enable@:="NO"}
  10. : ${nrpe_configfile:="@pkgsysconfdir@/nrpe.cfg"}
  11. name=nrpe
  12. command="@sbindir@/nrpe"
  13. command_args="-c $nrpe_configfile -d"
  14. pidfile="@piddir@/nrpe.pid"
  15. extra_commands=reload
  16. sig_reload=HUP
  17. rcvar=nrpe@bsd_enable@
  18. load_rc_config "$name"
  19. required_files="$nrpe_configfile"
  20. sig_reload=HUP
  21. start_precmd=nrpe_prestart
  22. nrpe_prestart()
  23. {
  24. [ -n "$nrpe_pidfile" ] &&
  25. warn "No longer necessary to set nrpe_pidfile in rc.conf[.local]"
  26. install -d -o @nrpe_user@ ${pidfile%/*}
  27. }
  28. run_rc_command "$1"