diff options
Diffstat (limited to 'recipes-extended/nagios/nagios-nsca/init-script.in')
-rw-r--r-- | recipes-extended/nagios/nagios-nsca/init-script.in | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/recipes-extended/nagios/nagios-nsca/init-script.in b/recipes-extended/nagios/nagios-nsca/init-script.in new file mode 100644 index 00000000..a76b34ed --- /dev/null +++ b/recipes-extended/nagios/nagios-nsca/init-script.in | |||
@@ -0,0 +1,67 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Last Modified 01-07-2003 Ethan Galstad (nagios@nagios.org) | ||
4 | # Notes | ||
5 | # This script takes care of starting and stopping the NSCA daemon. | ||
6 | # Modeled after init script for NRPE written by jaclu@grm.se | ||
7 | # | ||
8 | # chkconfig: 2345 80 30 | ||
9 | # description: nsca is a daemon for accepting service check results \ | ||
10 | # from applications running on other hosts. | ||
11 | # processname: nsca | ||
12 | # config: /usr/local/nagios/etc/nsca.cfg | ||
13 | |||
14 | ### BEGIN INIT INFO | ||
15 | # Provides: nsca | ||
16 | # Required-Start: $remote_fs $syslog | ||
17 | # Required-Stop: $remote_fs $syslog | ||
18 | # Default-Start: 2 3 4 5 | ||
19 | # Default-Stop: 0 1 6 | ||
20 | # Short-Description: start and stop nagios nsca daemon | ||
21 | # Description: start and stop nagios nsca daemon | ||
22 | ### END INIT INFO | ||
23 | |||
24 | |||
25 | # Source function library | ||
26 | if [ -f /etc/rc.d/init.d/functions ]; then | ||
27 | . /etc/rc.d/init.d/functions | ||
28 | elif [ -f /etc/init.d/functions ]; then | ||
29 | . /etc/init.d/functions | ||
30 | elif [ -f /etc/rc.d/functions ]; then | ||
31 | . /etc/rc.d/functions | ||
32 | fi | ||
33 | |||
34 | NscaBin=@bindir@/nsca | ||
35 | NscaCfg=@sysconfdir@/nsca.cfg | ||
36 | LockFile=/var/lock/nsca | ||
37 | |||
38 | # See how we were called. | ||
39 | case "$1" in | ||
40 | start) | ||
41 | # Start daemons. | ||
42 | echo -n "Starting nsca: " | ||
43 | start-stop-daemon --start --exec $NscaBin -- -s -c $NscaCfg | ||
44 | RETVAL=$? | ||
45 | echo | ||
46 | touch $LockFile | ||
47 | ;; | ||
48 | stop) | ||
49 | # Stop daemons. | ||
50 | echo -n "Shutting down nsca: " | ||
51 | start-stop-daemon --stop --exec $NscaBin | ||
52 | echo | ||
53 | rm -f $LockFile | ||
54 | ;; | ||
55 | restart) | ||
56 | $0 stop | ||
57 | $0 start | ||
58 | ;; | ||
59 | status) | ||
60 | status nsca | ||
61 | ;; | ||
62 | *) | ||
63 | echo "Usage: nsca {start|stop|restart|status}" | ||
64 | exit 1 | ||
65 | esac | ||
66 | |||
67 | exit 0 | ||