fi
[ -n "$GLITE_LB_HARVESTER_DBCS" ] && conf="$conf -m $GLITE_LB_HARVESTER_DBCS"
+HARVESTER_NOTIFSFILE=/var/tmp/notifs.txt
+
unset creds port log4c
[ -n "$GLITE_HOST_CERT" -a -n "$GLITE_HOST_KEY" ] &&
local name="$1"
local pidfile="$2"
local cmd="$3"
+ local stale="$4"
if [ -f "$pidfile" ]; then
if ps p `cat $pidfile` >/dev/null 2>&1; then
return 0
fi
- echo -n "Warning: stalled $pidfile for $name"
+ echo "Warning: stale $pidfile for $name"
rm -f "$pidfile"
+ if [ -n "$stale" ]; then
+ for file in $stale; do
+ echo "Warning: stale $file for $name"
+ rm -f "$file"
+ done
+ fi
fi
echo -n "Starting $name ..."
su - $GLITE_USER -c "$log4c $cmd" && echo " done" || echo " FAILED"
if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
- echo "$name not running (stalled pidfile)"
+ echo "$name not running (stale pidfile)"
return 1
fi
else
start_daemon glite-lb-harvester "$pidfile" "$GLITE_LOCATION/bin/glite-lb-harvester \
$creds $conf -i $pidfile -d $level $port --daemon\
- $GLITE_LB_HARVESTER_OTHER_OPTIONS"
+ $GLITE_LB_HARVESTER_OTHER_OPTIONS" "$HARVESTER_NOTIFSFILE"
}
stop()
LL_PIDFILE=${LL_PIDFILE:-$GLITE_LOCATION_VAR/glite-lb-logd.pid}
IL_PIDFILE=${IL_PIDFILE:-$GLITE_LOCATION_VAR/glite-lb-interlogd.pid}
+IL_SOCKFILE=/tmp/interlogger.sock
unset creds port log4c
local name="$1"
local pidfile="$2"
local cmd="$3"
+ local stale="$4"
if [ -f "$pidfile" ]; then
if ps p `cat $pidfile` >/dev/null 2>&1; then
return 0
fi
- echo -n "Warning: stalled $pidfile for $name"
+ echo "Warning: stale $pidfile for $name"
rm -f "$pidfile"
+ if [ -n "$stale" ]; then
+ for file in $stale; do
+ echo "Warning: stale $file for $name"
+ rm -f "$file"
+ done
+ fi
fi
echo -n "Starting $name ..."
su - $GLITE_USER -c "$log4c $cmd" && echo " done" || echo " FAILED"
if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
- echo "$name not running (stalled pidfile)"
+ echo "$name not running (stale pidfile)"
return 1
fi
else
-i $LL_PIDFILE $creds $port $sock $fprefix"
start_daemon "glite-lb-interlogd" "$IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-interlogd \
- -i $IL_PIDFILE $creds $sock $fprefix"
+ -i $IL_PIDFILE $creds $sock $fprefix" "$IL_SOCKFILE"
}
killwait()
if netstat -an --inet --inet6 | grep "^tcp .* \(::\|0.0.0.0\):${GLITE_LB_LOGGER_PORT:-9002} .*LISTEN" >/dev/null 2>&1 ;then
killall -9 glite-lb-logd
fi
- if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_IL_SOCK:-/tmp/interlogger.sock}$" >/dev/null 2>&1 ;then
+ if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_IL_SOCK:-$IL_SOCKFILE}$" >/dev/null 2>&1 ;then
killall -9 glite-lb-interlogd
fi
}
local name="$1"
local pidfile="$2"
local cmd="$3"
+ local stale="$4"
if [ -f "$pidfile" ]; then
- if ps p `cat $pidfile` >/dev/null 2>&2; then
+ if ps p `cat $pidfile` >/dev/null 2>&1; then
return 0
fi
- echo -n "Warning: stalled $pidfile for $name"
+ echo "Warning: stale $pidfile for $name"
rm -f "$pidfile"
+ if [ -n "$stale" ]; then
+ for file in $stale; do
+ echo "Warning: stale $file for $name"
+ rm -f "$file"
+ done
+ fi
fi
echo -n "Starting $name ..."
su - $GLITE_USER -c "$log4c $cmd" && echo " done" || echo " FAILED"
if ps p $pid >/dev/null 2>&1; then
echo "$name running as $pid"
else
- echo "$name not running (stalled pidfile)"
+ echo "$name not running (stale pidfile)"
return 1
fi
else
--notif-il-sock=$GLITE_LB_NOTIF_SOCK \
--notif-il-fprefix=$GLITE_LB_NOTIF_FPREFIX \
$super $creds -i $BK_PIDFILE $port $wport $dumpdir $purgedir $lbreg_maildir $proxy $policy\
- $GLITE_LB_SERVER_OTHER_OPTIONS"
+ $GLITE_LB_SERVER_OTHER_OPTIONS" "/tmp/lb_proxy_serve.sock /tmp/lb_proxy_store.sock"
if test -x $GLITE_LOCATION/bin/glite-lb-notif-interlogd; then
start_daemon glite-lb-notif-interlogd "$NOTIF_IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-notif-interlogd \
-f $GLITE_LB_NOTIF_FPREFIX -s $GLITE_LB_NOTIF_SOCK \
-i $NOTIF_IL_PIDFILE -M 10485760 \
- $creds $GLITE_LB_NOTIF_IL_OTHER_OPTIONS"
+ $creds $GLITE_LB_NOTIF_IL_OTHER_OPTIONS" "$GLITE_LB_NOTIF_SOCK"
else
echo Warning: glite-lb-notif-interlogd not installed, LB notifications will not work
fi
start_daemon "glite-lb-interlog for proxy" "$PROXY_IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-interlogd \
-f $GLITE_LB_PROXY_FPREFIX -s $GLITE_LB_PROXY_SOCK \
-i $PROXY_IL_PIDFILE \
- $creds $GLITE_LB_PROXY_IL_OTHER_OPTIONS"
+ $creds $GLITE_LB_PROXY_IL_OTHER_OPTIONS" "$GLITE_LB_PROXY_SOCK"
else
echo Warning: glite-lb-interlogd not installed, logging to LB proxy will not work
fi