]> git.pld-linux.org Git - packages/nagios-nrpe.git/blob - nrpe.init
LSB compliance
[packages/nagios-nrpe.git] / nrpe.init
1 #!/bin/sh
2 #
3 #  Created 2000-01-03 by jaclu@grm.se
4 #  Rewritten for PLD 2004-06-02 by patrys@pld-linux.org
5 #
6 # nrpe          This shell script takes care of starting and stopping
7 #               nrpe.
8 #
9 # chkconfig:    2345 80 30
10 # description:  nrpe is a daemon for a remote nagios server, \
11 #               running nagios plugins on this host.
12 # processname:  nrpe
13 # config:       /usr/local/nagios/etc/nrpe.cfg
14
15 . /etc/rc.d/init.d/functions
16
17 # Source networking configuration.
18 . /etc/sysconfig/network
19
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23                 msg_network_down "nrpe"
24                 exit 1
25         fi
26 else
27         exit 0
28 fi
29
30 case "$1" in
31   start)
32         if [ -f /var/lock/subsys/nrpe ]; then
33                 msg_already_running "nrpe"
34         else
35                 msg_starting "nrpe"
36                 daemon nrpe -c /etc/nagios/nrpe.cfg -d
37                 touch /var/lock/subsys/nrpe
38         fi
39         ;;
40   stop)
41         if [ -f /var/lock/subsys/nrpe ]; then
42                 msg_stopping "nrpe"
43                 killproc nrpe
44                 rm -f /var/lock/subsys/nrpe
45         else
46                 msg_not_running "nrpe"
47         fi
48         ;;
49   restart|force-reload)
50         $0 stop
51         $0 start
52         ;;
53   status)
54         status nrpe
55         exit $?
56         ;;
57   *)
58         echo "Usage: nrpe {start|stop|restart|force-reload|status}"
59         exit 3
60 esac
61
62 exit 0
This page took 0.60718 seconds and 4 git commands to generate.