File: munin-node.init

package info (click to toggle)
munin 2.999.14-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 10,036 kB
  • sloc: perl: 31,052; sh: 12,473; java: 1,924; python: 852; makefile: 336; ruby: 232; awk: 169; xml: 45; sql: 11
file content (37 lines) | stat: -rwxr-xr-x 1,218 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:          munin-node
# Required-Start:    $local_fs $network $remote_fs $syslog
# Required-Stop:     $local_fs $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Munin Node
# Description:       Munin Node, network resource monitoring tool
#                    The node runs monitoring plugins when a munin
#                    master connects.
### END INIT INFO

NAME=munin-node
DAEMON=/usr/bin/munin-node


# difference compared to "do_stop_cmd": remove "--exec" parameter
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843419
do_stop_cmd_override() {
	local RETVAL
	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
		$STOP_ARGS \
		${PIDFILE:+--pidfile ${PIDFILE}} --name $NAME
	RETVAL="$?"
	[ "$RETVAL" = 2 ] && return 2
	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
		$STOP_ARGS \
		${PIDFILE:+--pidfile ${PIDFILE}}
	[ "$?" = 2 ] && return 2
	rm -f "$PIDFILE"
	return "$RETVAL"
}