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=$(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
30 daemon monit -c /etc/monitrc -l syslog -d 60 -s /var/run/monit.state
32 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/monit
34 msg_already_running monit
40 if [ -f /var/lock/subsys/monit ]; then
42 daemon --waitforname monit --waitfortime 10 monit -c /etc/monitrc quit
43 rm -f /var/lock/subsys/monit > /dev/null 2>&1
50 # See how we were called.
64 if [ -f /var/lock/subsys/monit ]; then
67 daemon monit -c /etc/monitrc reload
76 echo "Config check OK"
80 monit -c /etc/monitrc status
84 msg_usage "$0 {start|stop|restart|reload|force-reload|checkconfig|status}"