From 56556bdeec338013578324f4735423c133affa05 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 7 Feb 2014 17:37:56 -0500 Subject: [PATCH] Fix xCAT init script status reporting xCAT in some cases was reporting improper status for certain scenarios. Risk being inaccure if no pid file exists so that it is accurate when it does exist. --- xCAT-server/etc/init.d/xcatd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-server/etc/init.d/xcatd b/xCAT-server/etc/init.d/xcatd index 282f360a5..493582c2c 100755 --- a/xCAT-server/etc/init.d/xcatd +++ b/xCAT-server/etc/init.d/xcatd @@ -37,7 +37,12 @@ RHFailure() } MStatus() { - ps ax|grep -v grep|grep xcatd: > /dev/null 2>&1 + PID=`cat /var/run/xcatd.pid` + if [ -z "$PID" ]; then + echo "xCAT service is not running" + return 3 + fi + ps $PID|grep xcatd: > /dev/null 2>&1 if [ "$?" = "0" ]; then RVAL=0 echo "xCAT service is running"