From adab157633d1ee85436a17ad49e53f4399ca2e7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 11 Nov 2010 16:54:20 +0000 Subject: [PATCH] Fixed BDII status reporting (ggus #62737). The problem was the startup script doing the check is called from different user and 'kill -0' has not the permissions. --- org.glite.lb.harvester/config/startup | 6 +++--- org.glite.lb.logger/config/startup | 4 ++-- org.glite.lb.server/config/startup | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/org.glite.lb.harvester/config/startup b/org.glite.lb.harvester/config/startup index abe657e..2169d4f 100755 --- a/org.glite.lb.harvester/config/startup +++ b/org.glite.lb.harvester/config/startup @@ -63,7 +63,7 @@ start_daemon() local cmd="$3" if [ -f "$pidfile" ]; then - if kill -0 `cat $pidfile`; then + if ps p `cat $pidfile` >/dev/null 2>&1; then return 0 fi echo -n "Warning: stalled $pidfile for $name" @@ -83,7 +83,7 @@ stop_daemon() echo -n Stopping $name \($pid\) ... kill $pid try=0 - while kill -0 $pid >/dev/null 2>&1; do + while ps p $pid >/dev/null 2>&1; do sleep 1; try=`expr $try + 1` if [ $try = 20 ]; then @@ -108,7 +108,7 @@ status_daemon() if [ -f "$pidfile" ]; then pid=`cat "$pidfile"` - if kill -0 $pid >/dev/null 2>&1; then + if ps p $pid >/dev/null 2>&1; then echo "$name running as $pid" else echo "$name not running (stalled pidfile)" diff --git a/org.glite.lb.logger/config/startup b/org.glite.lb.logger/config/startup index 4bc7b50..5c3139d 100755 --- a/org.glite.lb.logger/config/startup +++ b/org.glite.lb.logger/config/startup @@ -40,7 +40,7 @@ start_daemon() local cmd="$3" if [ -f "$pidfile" ]; then - if kill -0 `cat $pidfile`; then + if ps p `cat $pidfile` >/dev/null 2>&1; then return 0 fi echo -n "Warning: stalled $pidfile for $name" @@ -57,7 +57,7 @@ status_daemon() if [ -f "$pidfile" ]; then pid=`cat "$pidfile"` - if kill -0 $pid >/dev/null 2>&1; then + if ps p $pid >/dev/null 2>&1; then echo "$name running as $pid" else echo "$name not running (stalled pidfile)" diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index 22bc30d..a47cb8a 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -51,7 +51,7 @@ start_daemon() local cmd="$3" if [ -f "$pidfile" ]; then - if kill -0 `cat $pidfile`; then + if ps p `cat $pidfile` >/dev/null 2>&2; then return 0 fi echo -n "Warning: stalled $pidfile for $name" @@ -71,7 +71,7 @@ stop_daemon() echo -n Stopping $name \($pid\) ... kill $pid try=0 - while kill -0 $pid >/dev/null 2>&1; do + while ps p $pid >/dev/null 2>&1; do sleep 1; try=`expr $try + 1` if [ $try = 20 ]; then @@ -96,7 +96,7 @@ status_daemon() if [ -f "$pidfile" ]; then pid=`cat "$pidfile"` - if kill -0 $pid >/dev/null 2>&1; then + if ps p $pid >/dev/null 2>&1; then echo "$name running as $pid" else echo "$name not running (stalled pidfile)" -- 1.8.2.3