[Nagios-devel] [PATCH 3/3] Fix /etc/init.d/nagios status return code

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 3/3] Fix /etc/init.d/nagios status return code

Post by Guest »

From: Ricky Zhou

---
daemon-init.in | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/daemon-init.in b/daemon-init.in
index 6da9166..4dc3ed4 100644
--- a/daemon-init.in
+++ b/daemon-init.in
@@ -57,12 +57,14 @@ status_nagios ()

printstatus_nagios()
{
-
- if status_nagios $1 $2; then
+ status_nagios $1 $2
+ RETVAL=$?
+ if [ $RETVAL = 0 ]; then
echo "nagios (pid $NagiosPID) is running..."
else
echo "nagios is not running"
fi
+ return $RETVAL
}


@@ -176,6 +178,7 @@ case "$1" in
status)
pid_nagios
printstatus_nagios nagios
+ exit $?
;;

checkconfig)
--
1.7.3.2






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked