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