mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-12 07:14:20 +00:00
launch_local_testnet.sh: fix terminating Geth (#4684)
Also improve logging and list jobs after cleanup. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
3681177cf4
commit
2f36f15b20
@ -746,15 +746,15 @@ cleanup() {
|
||||
echo "Existing processes:"
|
||||
for proc in "${PROCS_TO_KILL[@]}"; do
|
||||
PROC_NAME=$(basename "$proc")
|
||||
pgrep -alf "${PROC_NAME}" || true
|
||||
pgrep -al "${PROC_NAME}" || true
|
||||
done
|
||||
|
||||
echo "Terminating:"
|
||||
for proc in "${PROCS_TO_KILL[@]}"; do
|
||||
PROC_NAME=$(basename "$proc")
|
||||
echo -n "Terminating ${PROC_NAME}: " >&2
|
||||
# WARNING: The '-P $$' avoids killing unrelated processes.
|
||||
pkill -SIGTERM "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" \
|
||||
|| echo "Nothing to terminate: ${PROC_NAME}"
|
||||
pkill -SIGTERM "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" || true
|
||||
done
|
||||
|
||||
sleep 2
|
||||
@ -762,9 +762,9 @@ cleanup() {
|
||||
echo "Killing:"
|
||||
for proc in "${PROCS_TO_KILL[@]}"; do
|
||||
PROC_NAME=$(basename "$proc")
|
||||
echo -n "Killing ${PROC_NAME}: " >&2
|
||||
# WARNING: The '-P $$' avoids killing unrelated processes.
|
||||
pkill -SIGKILL "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" \
|
||||
|| echo "Nothing to kill: ${PROC_NAME}"
|
||||
pkill -SIGKILL "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" || true
|
||||
done
|
||||
|
||||
# Delete all binaries we just built, because these are unusable outside this
|
||||
@ -786,6 +786,9 @@ cleanup() {
|
||||
rm -rf "${dir}"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Jobs status after cleanup:"
|
||||
jobs
|
||||
}
|
||||
|
||||
trap 'cleanup' SIGINT SIGTERM EXIT
|
||||
|
@ -12,11 +12,9 @@ GETH_ENODES=()
|
||||
|
||||
log "Using ${GETH_BINARY}"
|
||||
|
||||
start_geth_node() {
|
||||
GETH_NODE_IDX=$1
|
||||
for GETH_NODE_IDX in $(seq 0 $GETH_LAST_NODE_IDX); do
|
||||
mkdir -p "${GETH_DATA_DIRS[GETH_NODE_IDX]}"
|
||||
set -x
|
||||
|
||||
${GETH_BINARY} version
|
||||
${GETH_BINARY} --datadir "${GETH_DATA_DIRS[GETH_NODE_IDX]}" init "${EXECUTION_GENESIS_JSON}"
|
||||
${GETH_BINARY} \
|
||||
@ -27,12 +25,9 @@ start_geth_node() {
|
||||
--http.port ${GETH_RPC_PORTS[GETH_NODE_IDX]} \
|
||||
--port ${GETH_NET_PORTS[GETH_NODE_IDX]} \
|
||||
--authrpc.port ${GETH_AUTH_RPC_PORTS[GETH_NODE_IDX]} \
|
||||
--authrpc.jwtsecret "${JWT_FILE}"
|
||||
}
|
||||
|
||||
for GETH_NODE_IDX in $(seq 0 $GETH_LAST_NODE_IDX); do
|
||||
start_geth_node $GETH_NODE_IDX \
|
||||
&> "${DATA_DIR}/geth-log${GETH_NODE_IDX}.txt" &
|
||||
--authrpc.jwtsecret "${JWT_FILE}" \
|
||||
&> "${DATA_DIR}/geth-log${GETH_NODE_IDX}.txt" &
|
||||
set +x
|
||||
done
|
||||
|
||||
for GETH_NODE_IDX in $(seq 0 $GETH_LAST_NODE_IDX); do
|
||||
|
Loading…
x
Reference in New Issue
Block a user