]> git.pld-linux.org Git - packages/monit.git/blame - monit.init
- killed my previous bogus "fixes"
[packages/monit.git] / monit.init
CommitLineData
dfab42e0
AM
1#!/bin/sh
2#
3# monit Monitoring daemon
4#
5# chkconfig: 345 99 1
6# description: Monitoring daemon
7#
8
9# Source function library
10. /etc/rc.d/init.d/functions
11
12# Get service config
13[ -f /etc/sysconfig/monit ] && . /etc/sysconfig/monit
14
15# See how we were called.
16case "$1" in
17 start)
18 # Check if the service is already running?
d7723a0c 19 if [ ! -f /var/lock/subsys/monit ]; then
dfab42e0
AM
20 msg_starting monit
21 daemon monit -c /etc/monitrc -l syslog -d 60
d7723a0c 22 RETVAL=$?
23 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/monit
dfab42e0 24 else
d7723a0c 25 msg_already_running monit
26 exit 1
dfab42e0
AM
27 fi
28 ;;
29 stop)
d7723a0c 30 # Stop daemons.
dfab42e0 31 if [ -f /var/lock/subsys/monit ]; then
d7723a0c 32 msg_stopping monit
33 killproc monit
dfab42e0 34 RETVAL=$?
d7723a0c 35 rm -f /var/lock/subsys/monit > /dev/null 2>&1
36 else
dfab42e0 37 msg_not_running monit
d7723a0c 38 exit 1
dfab42e0
AM
39 fi
40 ;;
41 status)
42 status monit
43 RETVAL=$?
44 ;;
45 restart)
46 $0 stop
47 $0 start
48 ;;
d7723a0c 49 reload)
50 msg_reloading monit
dfab42e0
AM
51 killproc monit -HUP
52 RETVAL=$?
53 ;;
54 *)
d7723a0c 55 msg_usage "$0 {start|stop|restart|reload|status}"
dfab42e0
AM
56 exit 1
57 ;;
58esac
59
60exit $RETVAL
This page took 0.815311 seconds and 4 git commands to generate.