Terminate child process when main script is interrupted

This commit is contained in:
Michael Vines
2018-07-30 14:29:34 -07:00
parent 95b98b3845
commit 647053e973
3 changed files with 13 additions and 6 deletions

View File

@ -36,7 +36,10 @@ set -ex
mkdir -p "$SOLANA_CONFIG_DIR"
$rsync -vPz "$rsync_leader_url"/config/leader.json "$SOLANA_CONFIG_DIR"/
set -o pipefail
trap 'kill "$pid" && wait "$pid"' INT TERM
$solana_drone \
-l "$SOLANA_CONFIG_DIR"/leader.json -k "$SOLANA_CONFIG_PRIVATE_DIR"/mint.json \
2>&1 | $drone_logger
> >($drone_logger) 2>&1 &
pid=$!
wait "$pid"