3 # monit Monitoring daemon
6 # description: Monitoring daemon
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 [ -f /etc/sysconfig/monit ] && . /etc/sysconfig/monit
17 out=$(/usr/sbin/monit -c /etc/monitrc -t 2>&1)
19 if [ $ret != 0 ]; then
26 # Check if the service is already running?
27 if [ -f /var/lock/subsys/monit ]; then
28 msg_already_running monit
34 daemon --pidfile /var/run/monit.pid /usr/sbin/monit -c /etc/monitrc -s /var/run/monit.state $OPTIONS
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/monit
41 if [ ! -f /var/lock/subsys/monit ]; then
48 /usr/sbin/monit -c /etc/monitrc quit
50 [ $RETVAL -eq 0 ] && ok || fail
51 rm -f /var/lock/subsys/monit > /dev/null 2>&1
55 if [ ! -f /var/lock/subsys/monit ]; then
63 /usr/sbin/monit -c /etc/monitrc reload
65 [ $RETVAL -eq 0 ] && ok || fail
69 # See how we were called.
87 echo "Config check OK"
91 monit -c /etc/monitrc status
95 msg_usage "$0 {start|stop|restart|reload|force-reload|checkconfig|status}"