nagios-nrpe/nagios-nrpe-2.13-initscript_return_codes.patch

50 lines
893 B
Diff
Raw Normal View History

--- 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