Fix up signal handling

This commit is contained in:
Michael Vines 2019-07-19 08:32:03 -07:00
parent 06cd7c1020
commit a21251dfea
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 3 additions and 2 deletions

View File

@ -380,6 +380,7 @@ kill_fullnode() {
kill "$_pid" || true
wait "$_pid" || true
fi
exit
}
trap 'kill_fullnode' INT TERM ERR
@ -498,8 +499,8 @@ EOF
secs_to_next_genesis_poll=5
secs_to_next_snapshot=30
while true; do
if ! kill -0 "$pid"; then
wait "$pid" || true
if [[ -z $pid ]] || ! kill -0 "$pid"; then
[[ -z $pid ]] || wait "$pid"
echo "############## $node_type exited, restarting ##############"
break
fi