From b9d133970686b5313b017f5fa924f09ae6418ede Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 5 Oct 2010 14:54:02 +0000 Subject: [PATCH] Fix the status in startup script due to disabled daemons. --- org.glite.lb.server/config/startup | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index d0a6ce9..22bc30d 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -92,18 +92,24 @@ status_daemon() { local name="$1" local pidfile="$2" + local enabled="$3" if [ -f "$pidfile" ]; then pid=`cat "$pidfile"` if kill -0 $pid >/dev/null 2>&1; then - echo $name running as $pid + echo "$name running as $pid" else - echo $name not running + echo "$name not running (stalled pidfile)" return 1 fi else - echo $name not running - return 1 + if test -n "$enabled" -a x"$enabled" = x"0"; then + echo "$name not running (disabled)" + return 0 + else + echo "$name not running" + return 1 + fi fi return 0 @@ -256,14 +262,20 @@ stop() status() { retval=0 - - status_daemon "glite-lb-notif-interlogd" "$NOTIF_IL_PIDFILE" || retval=1 - status_daemon "glite-lb-interlogd for proxy" "$PROXY_IL_PIDFILE" || retval=1 - - status_daemon "glite-lb-bkserverd" "$BK_PIDFILE" || retval=1 - if test x"$GLITE_LB_EXPORT_ENABLED" = x"true"; then - status_daemon "glite-jp-importer" "$jp_importer_pidfile" || retval=1 - fi + proxy=0 + jp=0 + test x"$GLITE_LB_TYPE" = x"proxy" -o x"$GLITE_LB_TYPE" = x"both" \ + && proxy=1 + test x"$GLITE_LB_EXPORT_ENABLED" = x"true" && jp=1 + + status_daemon "glite-lb-notif-interlogd" "$NOTIF_IL_PIDFILE" \ + || retval=1 + status_daemon "glite-lb-interlogd for proxy" "$PROXY_IL_PIDFILE" \ + $proxy || retval=1 + status_daemon "glite-lb-bkserverd" "$BK_PIDFILE" \ + || retval=1 + status_daemon "glite-jp-importer" "$jp_importer_pidfile" $jp \ + || retval=1 return $retval } -- 1.8.2.3