More fixes for distributed operation.

This commit is contained in:
Louwrentius 2009-11-08 16:58:06 +00:00
parent cd4545d0c3
commit d08dc38761

13
ppss.sh
View File

@ -1472,15 +1472,14 @@ listen_for_job () {
# This mechanism makes PPSS asynchronous. # This mechanism makes PPSS asynchronous.
# Gives a status update on the current progress.. # Gives a status update on the current progress..
echo "$event" >> event.txt
if [ "$event" == "$STOP_KEY" ] if [ "$event" == "$STOP_KEY" ]
then then
((DIED++)) ((DIED++))
if [ "$DIED" -ge "$MAX_NO_OF_RUNNING_JOBS" ] if [ "$DIED" -ge "$MAX_NO_OF_RUNNING_JOBS" ]
then then
break kill_process
fi else
RES=$((MAX_NO_OF_RUNNING_JOBS-DIED)) RES=$((MAX_NO_OF_RUNNING_JOBS-DIED))
if [ "$RES" == "1" ] if [ "$RES" == "1" ]
then then
@ -1489,18 +1488,18 @@ listen_for_job () {
log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) jobs are remaining." log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) jobs are remaining."
echo -en "\033[1A" echo -en "\033[1A"
fi fi
fi
elif [ "$event" == "$KILL_KEY" ] elif [ "$event" == "$KILL_KEY" ]
then then
for x in $PIDS for x in $PIDS
do do
log DEBUG "Killing pid $x..."
kill $x >> /dev/null 2>&1 kill $x >> /dev/null 2>&1
done done
cleanup
if [ ! -z "$SSH_MASTER_PID" ] if [ ! -z "$SSH_MASTER_PID" ]
then then
kill -9 "$SSH_MASTER_PID" >> /dev/null 2>&1 kill "$SSH_MASTER_PID" #>> /dev/null 2>&1
fi fi
cleanup
log INFO "Finished. Consult ./$JOB_LOG_DIR for job output." log INFO "Finished. Consult ./$JOB_LOG_DIR for job output."
break break
else else
@ -1523,6 +1522,7 @@ listen_for_job () {
fi fi
fi fi
done done
set_status STOPPED set_status STOPPED
log DEBUG "Listener stopped." log DEBUG "Listener stopped."
exit exit
@ -1717,7 +1717,6 @@ main () {
* ) * )
init_vars init_vars
test_server
get_all_items get_all_items
listen_for_job "$MAX_NO_OF_RUNNING_JOBS" & 2>&1 >> /dev/null listen_for_job "$MAX_NO_OF_RUNNING_JOBS" & 2>&1 >> /dev/null
LISTENER_PID=$! LISTENER_PID=$!