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

Peter Lemenkov lemenkov at gmail.com
Mon Nov 15 14:45:19 CET 2010


From: Ricky Zhou <rzhou at redhat.com>

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


------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev




More information about the Developers mailing list