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
30 daemon --pidfile /var/run/monit.pid /usr/sbin/monit -c /etc/monitrc -s /var/run/monit.state $OPTIONS
32 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/monit
34 msg_already_running monit
40 if [ -f /var/lock/subsys/monit ]; then
43 /usr/sbin/monit -c /etc/monitrc quit
45 [ $RETVAL -eq 0 ] && ok || fail
46 rm -f /var/lock/subsys/monit > /dev/null 2>&1
53 # See how we were called.
67 if [ -f /var/lock/subsys/monit ]; then
71 /usr/sbin/monit -c /etc/monitrc reload
73 [ $RETVAL -eq 0 ] && ok || fail
81 echo "Config check OK"
85 monit -c /etc/monitrc status
89 msg_usage "$0 {start|stop|restart|reload|force-reload|checkconfig|status}"