diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-20 13:16:40 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-01-20 13:16:40 +0000 |
commit | 8ead7a5dd2a21b3c51cab6f740c6f63c9fe31896 (patch) | |
tree | e96b54dc7e8e59fd3af32abdbe24c3bd843a7904 /main/nrpe/nrpe.initd | |
parent | 5c26937f96946360ecb19a6db1093c508e4df980 (diff) | |
download | aports-8ead7a5dd2a21b3c51cab6f740c6f63c9fe31896.tar.bz2 aports-8ead7a5dd2a21b3c51cab6f740c6f63c9fe31896.tar.xz |
main/nrpe: moved from testing
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 000000000..0bff759ce --- /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 $? +} + |