Terminate child process when main script is interrupted
This commit is contained in:
parent
95b98b3845
commit
647053e973
|
@ -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"
|
||||
|
|
|
@ -25,8 +25,10 @@ fi
|
|||
|
||||
tune_networking
|
||||
|
||||
set -xo pipefail
|
||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||
$program \
|
||||
--identity "$SOLANA_CONFIG_DIR"/leader.json \
|
||||
--ledger "$SOLANA_CONFIG_DIR"/ledger.log \
|
||||
2>&1 | $leader_logger
|
||||
> >($leader_logger) 2>&1 &
|
||||
pid=$!
|
||||
wait "$pid"
|
||||
|
|
|
@ -84,9 +84,11 @@ while ! $solana_wallet \
|
|||
sleep 1
|
||||
done
|
||||
|
||||
set -o pipefail
|
||||
trap 'kill "$pid" && wait "$pid"' INT TERM
|
||||
$program \
|
||||
--identity "$SOLANA_CONFIG_DIR"/validator.json \
|
||||
--testnet "$leader_address:$leader_port" \
|
||||
--ledger "$SOLANA_LEADER_CONFIG_DIR"/ledger.log \
|
||||
2>&1 | $validator_logger
|
||||
> >($validator_logger) 2>&1 &
|
||||
pid=$!
|
||||
wait "$pid"
|
||||
|
|
Loading…
Reference in New Issue