File: munin-node.init

package info (click to toggle)
munin 2.0.73-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,044 kB
  • sloc: perl: 11,682; java: 1,924; sh: 1,619; makefile: 636; javascript: 365; python: 267
file content (39 lines) | stat: -rw-r--r-- 1,451 bytes parent folder | download | duplicates (4)
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
38
39
#!/usr/bin/env /lib/init/init-d-script

### BEGIN INIT INFO
# Provides:          munin-node
# Required-Start:    $network $named $local_fs $remote_fs
# Required-Stop:     $network $named $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Munin-Node service
# Description:       Munin-Node service allowing local or remote retrieval of monitoring data
### END INIT INFO

DESC="Munin-Node service"
DAEMON=/usr/sbin/munin-node
PIDFILE=$(sed -nE 's/^\s*pid_file\s+//p' /etc/munin/munin-node.conf)
PIDFILE=${PIDFILE:-/run/munin/munin-node.pid}
# arguments for "start-stop-daemon"
START_ARGS="--background --notify-await --notify-timeout 15"
# arguments for "munin-node"
DAEMON_ARGS="--foreground"


do_start_prepare() {
    mkdir -p /run/munin /var/log/munin
    chown munin:root /run/munin
    chown munin:adm /var/log/munin
    chmod 0755 /run/munin
    chmod 0755 /var/log/munin
}


# start-stop-daemon's "--exec" match does not work for scripts (with an interpreter).  Thus we
# override the DAEMON path with the interpreter during "stop".
# Due to this broad "--exec" match (possibly hitting any existing perl script), we need to prevent
# the second "--stop" call of "start-stop-daemon" specified in the original "do_stop_cmd" function.
do_stop_cmd_override() {
    start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 \
        --pidfile "$PIDFILE" --name munin-node --exec /usr/bin/perl
}