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