nagios-nrpe/nagios-nrpe-2.13-initscript_return_codes.patch
Silvan Calarco c4e68e7c68 require nagios-plugins
install a default nrpe command configuration for nagios [release 2.15-2mamba;Wed May 07 2014]
2024-01-06 07:30:52 +01:00

50 lines
893 B
Diff

--- nrpe-2.13/init-script.in 2012-10-23 23:01:45.000000000 +0200
+++ nrpe-2.13/init-script.in.retcodes 2012-10-23 23:04:51.000000000 +0200
@@ -36,21 +36,25 @@
NrpeCfg=@sysconfdir@/nrpe.cfg
LockFile=/var/lock/subsys/nrpe
+RETVAL=0
+
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting nrpe: "
daemon $NrpeBin -c $NrpeCfg -d $NRPE_OPTS
+ RETVAL=$?
echo
- touch $LockFile
+ [ $RETVAL = 0 ] && touch $LockFile
;;
stop)
# Stop daemons.
echo -n "Shutting down nrpe: "
killproc nrpe
+ RETVAL=$?
echo
- rm -f $LockFile
+ [ $RETVAL = 0 ] && rm -f $LockFile
;;
restart)
$0 stop
@@ -59,14 +63,16 @@
reload)
echo -n "Reloading nrpe: "
killproc nrpe -HUP
+ RETVAL=$?
echo
;;
status)
status nrpe
+ RETVAL=$?
;;
*)
echo "Usage: nrpe {start|stop|restart|reload|status}"
- exit 1
+ RETVAL=2
esac
-exit 0
+exit $RETVAL