Skip to content
Snippets Groups Projects
Commit 2287a765 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

wait demasiado temprano

parent af2c7fb7
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,12 @@ function reaper()
do
kill -0 $pid 2>/dev/null && continue
rc=wait $pid
echo "${PIDIDX[$pid]} (pid $pid) has exited with value $rc"
unset aaa[$pid]
echo "*** ${PIDIDX[$pid]} (pid $pid) has exited with value $rc"
unset PIDIDX[$pid]
done
# kill all - an extra kill doesn't hurt. I hope.
kill ${!PIDIDX[*]} 2>/dev/null || true
max=30
}
if [ "$VIRTUALIZATION" = "DOCKER" ]
......@@ -86,13 +89,8 @@ echo "*** Starting monitor.js"
monitor.js > ${LOGPIPE} 2>&1 &
PIDIDX[$!]="monitor.js"
wait -n # if one dies
sleep 2 # give log.sh time to work on the data written, before we kill it.
echo "*** Some process ended, so will shut down other processes too." > ${LOGPIPE}
kill ${!PIDIDX[*]} 2>/dev/null || true # kill all
# wait for them all to end
max=30
while [ -n "${!PIDIDX[*]}" -a $max -gt 0 ]
max=-1
while [ -n "${!PIDIDX[*]}" -a $max -eq 0 ]
do
sleep 1
max=$(( $max - 1 ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment