diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-08-28 22:03:42 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-08-28 22:04:40 +0200 |
commit | 06c2c852f60d5936df87d22ed52210164aa81735 (patch) | |
tree | 3588b1227db1cc0a08373c261e91a3608395dbb9 /main/nrpe/nrpe.initd | |
parent | 7c0d8c329bd8243b567190add4f3e5e706cf7480 (diff) | |
download | aports-06c2c852f60d5936df87d22ed52210164aa81735.tar.bz2 aports-06c2c852f60d5936df87d22ed52210164aa81735.tar.xz |
main/nrpe: patch to not daemonize itself, improve runscript
Diffstat (limited to 'main/nrpe/nrpe.initd')
-rw-r--r-- | main/nrpe/nrpe.initd | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/main/nrpe/nrpe.initd b/main/nrpe/nrpe.initd index 71ccc0ad0a..1dba19b1b5 100644 --- a/main/nrpe/nrpe.initd +++ b/main/nrpe/nrpe.initd @@ -1,37 +1,19 @@ #!/sbin/openrc-run -# Sample init.d file for alpine linux. +: ${user:="nagios"} +: ${cfgfile:="/etc/nrpe.cfg"} +: ${nrpe_options:=" -c $cfgfile"} # for backward compatibility -daemon=/usr/bin/nrpe -conf=/etc/nrpe.cfg +command="/usr/bin/nrpe" +command_args="-f $nrpe_options ${command_args:-}" +command_background="yes" + +pidfile="/run/$RC_SVCNAME.pid" +start_stop_daemon_args=" + --user $user + ${group:+--group $group}" 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 -- -d ${nrpe_options:- -c $conf} - eend $? -} - -stop() { - get_pidfile - ebegin "Stopping NRPE" - start-stop-daemon --stop --quiet \ - --exec $daemon \ - --pidfile $pidfile - eend $? -} - |