~ubuntu-branches/ubuntu/karmic/nagios-nrpe/karmic

« back to all changes in this revision

Viewing changes to init-script.in

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2004-05-15 12:02:35 UTC
  • Revision ID: james.westby@ubuntu.com-20040515120235-52bbrpj39ss7wlvu
Tags: upstream-2.0
ImportĀ upstreamĀ versionĀ 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
#  Created 2000-01-03 by jaclu@grm.se
 
4
#
 
5
# nrpe          This shell script takes care of starting and stopping
 
6
#               nrpe.
 
7
#
 
8
# chkconfig: 2345 80 30
 
9
# description: nrpe is a daemon for a remote nagios server, \
 
10
#              running nagios plugins on this host.
 
11
# processname: nrpe
 
12
# config: /usr/local/nagios/etc/nrpe.cfg
 
13
 
 
14
 
 
15
# Source function library
 
16
if [ -f /etc/rc.d/init.d/functions ]; then
 
17
. /etc/rc.d/init.d/functions
 
18
elif [ -f /etc/init.d/functions ]; then
 
19
. /etc/init.d/functions
 
20
elif [ -f /etc/rc.d/functions ]; then
 
21
. /etc/rc.d/functions
 
22
fi
 
23
 
 
24
# Source networking configuration.
 
25
. /etc/sysconfig/network
 
26
 
 
27
# Check that networking is up.
 
28
[ ${NETWORKING} = "no" ] && exit 0
 
29
 
 
30
NrpeBin=@bindir@/nrpe
 
31
NrpeCfg=@sysconfdir@/nrpe.cfg
 
32
LockFile=/var/lock/subsys/nrpe
 
33
 
 
34
# See how we were called.
 
35
case "$1" in
 
36
  start)
 
37
        # Start daemons.
 
38
        echo -n "Starting nrpe: "
 
39
        daemon $NrpeBin -c $NrpeCfg -d
 
40
        echo
 
41
        touch $LockFile
 
42
        ;;
 
43
  stop)
 
44
        # Stop daemons.
 
45
        echo -n "Shutting down nrpe: "
 
46
        killproc nrpe
 
47
        echo
 
48
        rm -f $LockFile
 
49
        ;;
 
50
  restart)
 
51
        $0 stop
 
52
        $0 start
 
53
        ;;
 
54
  status)
 
55
        status nrpe
 
56
        ;;
 
57
  *)
 
58
        echo "Usage: nrpe {start|stop|restart|status}"
 
59
        exit 1
 
60
esac
 
61
 
 
62
exit 0