monit.initd-5.0-r1 798 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2016 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License, v2 or later
  4. extra_commands="configtest"
  5. extra_started_commands="reload"
  6. command="/usr/bin/monit"
  7. depend() {
  8. use net
  9. }
  10. configtest() {
  11. ${command} -t 1>/dev/null 2>&1
  12. ret=$?
  13. if [ $ret -ne 0 ]; then
  14. eerror "${SVCNAME} has detected an error in your setup:"
  15. ${command} -t
  16. fi
  17. return $ret
  18. }
  19. start() {
  20. ebegin "Starting monit"
  21. start-stop-daemon --start --quiet --exec ${command} >/dev/null 2>&1
  22. eend $?
  23. }
  24. stop() {
  25. ebegin "Stopping monit"
  26. start-stop-daemon --stop --quiet --exec ${command}
  27. eend $?
  28. }
  29. reload() {
  30. ebegin "Reloading monit"
  31. ${command} -c /etc/monitrc reload >/dev/null 2>&1
  32. eend $?
  33. }