diff options
Diffstat (limited to 'main/nrpe/nrpe.initd')
-rw-r--r-- | main/nrpe/nrpe.initd | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/main/nrpe/nrpe.initd b/main/nrpe/nrpe.initd new file mode 100644 index 0000000000..0bff759cee --- /dev/null +++ b/main/nrpe/nrpe.initd @@ -0,0 +1,37 @@ +#!/sbin/runscript + +# Sample init.d file for alpine linux. + +daemon=/usr/bin/nrpe +conf=/etc/nrpe.cfg + +depend() { + need net + after firewall +} + +get_pidfile() { + if [ -r $conf ]; then + pidfile=$(awk -F= '/^pid_file/ {print $2}' $conf) + fi + pidfile=${pidfile:-/var/run/nrpe.pid} +} + +start() { + get_pidfile + ebegin "Starting NRPE" + start-stop-daemon --start --quiet \ + --pidfile $pidfile \ + --exec $daemon -- ${nrpe_options:- -c $conf -d} + eend $? +} + +stop() { + get_pidfile + ebegin "Stopping NRPE" + start-stop-daemon --stop --quiet \ + --exec $daemon \ + --pidfile $pidfile + eend $? +} + |