Refine killNode logging

This commit is contained in:
Michael Vines 2019-05-12 20:34:22 -07:00
parent dccfe31e8c
commit 06378d6db6
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 4 additions and 5 deletions

View File

@ -169,13 +169,11 @@ startNodes() {
killNode() { killNode() {
declare pid=$1 declare pid=$1
echo "kill $pid"
set +e set +e
if kill "$pid"; then if kill "$pid"; then
echo "Waiting for $pid to exit..."
wait "$pid" wait "$pid"
else echo "$pid exited with $?"
echo "^^^ +++"
echo "Warning: unable to kill $pid"
fi fi
set -e set -e
} }
@ -199,10 +197,11 @@ killNodes() {
# Give the nodes a splash of time to cleanly exit before killing them # Give the nodes a splash of time to cleanly exit before killing them
sleep 2 sleep 2
echo "--- Killing nodes" echo "--- Killing nodes: ${pids[*]}"
for pid in "${pids[@]}"; do for pid in "${pids[@]}"; do
killNode "$pid" killNode "$pid"
done done
echo "done killing nodes"
pids=() pids=()
} }