More fixes for distributed operation.
This commit is contained in:
parent
845473697c
commit
22fba8c1d7
|
@ -1472,35 +1472,34 @@ 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
|
|
||||||
RES=$((MAX_NO_OF_RUNNING_JOBS-DIED))
|
|
||||||
if [ "$RES" == "1" ]
|
|
||||||
then
|
|
||||||
log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) job is remaining. "
|
|
||||||
else
|
else
|
||||||
log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) jobs are remaining."
|
RES=$((MAX_NO_OF_RUNNING_JOBS-DIED))
|
||||||
echo -en "\033[1A"
|
if [ "$RES" == "1" ]
|
||||||
|
then
|
||||||
|
log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) job is remaining. "
|
||||||
|
else
|
||||||
|
log INFO "$((MAX_NO_OF_RUNNING_JOBS-DIED)) jobs are remaining."
|
||||||
|
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=$!
|
||||||
|
|
Loading…
Reference in New Issue