debian-init.in 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016 Nagios(R) Core(TM) Development Team
  4. #
  5. # Start/stop the nrpe daemon.
  6. NRPE_BIN=@sbindir@/nrpe
  7. NRPE_CFG=@pkgsysconfdir@/nrpe.cfg
  8. PID_FILE=@piddir@/nrpe.pid
  9. test -x $NRPE_BIN || exit 0
  10. case "$1" in
  11. start)
  12. echo -n "Starting nagios remote plugin daemon: nrpe"
  13. start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
  14. echo "."
  15. ;;
  16. stop)
  17. echo -n "Stopping nagios remote plugin daemon: nrpe"
  18. start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
  19. echo "."
  20. ;;
  21. restart|force-reload)
  22. echo -n "Restarting nagios remote plugin daemon: nrpe"
  23. start-stop-daemon --stop --quiet --pidfile $PID_FILE --exec $NRPE_BIN
  24. start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $NRPE_BIN -- -c $NRPE_CFG -d
  25. echo "."
  26. ;;
  27. reload)
  28. echo -n "Reloading configuration files for nagios remote plugin daemon: nrpe"
  29. test -f $PID_FILE || exit 0
  30. test -x /bin/kill && /bin/kill -HUP `cat $PID_FILE`
  31. echo "."
  32. ;;
  33. *)
  34. echo "Usage: $0 start|stop|restart|reload|force-reload"
  35. exit 1
  36. ;;
  37. esac
  38. exit 0