From f46ed12f0412661822ee60516716ab0be0ab90f3 Mon Sep 17 00:00:00 2001 From: Jakub Date: Tue, 28 Feb 2023 11:39:39 +0100 Subject: [PATCH] launch_local_testnet.sh: re-add targetting parent PID (#4680) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we kill of other unrelated processes. Fix for bug introduced most probably in: https://github.com/status-im/nimbus-eth2/pull/4551 Signed-off-by: Jakub SokoĊ‚owski --- scripts/launch_local_testnet.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/launch_local_testnet.sh b/scripts/launch_local_testnet.sh index 7f8a0d790..e983da200 100755 --- a/scripts/launch_local_testnet.sh +++ b/scripts/launch_local_testnet.sh @@ -751,9 +751,9 @@ cleanup() { echo "Terminating:" for proc in "${PROCS_TO_KILL[@]}"; do - # FIXME We should be using '-P $$' here but it doesn't always work. PROC_NAME=$(basename "$proc") - pkill -SIGTERM "${PKILL_ECHO_FLAG}" -f "${PROC_NAME}" \ + # WARNING: The '-P $$' avoids killing unrelated processes. + pkill -SIGTERM "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" \ || echo "Nothing to terminate: ${PROC_NAME}" done @@ -761,9 +761,9 @@ cleanup() { echo "Killing:" for proc in "${PROCS_TO_KILL[@]}"; do - # FIXME We should be using '-P $$' here but it doesn't always work. PROC_NAME=$(basename "$proc") - pkill -SIGKILL "${PKILL_ECHO_FLAG}" -f "${PROC_NAME}" \ + # WARNING: The '-P $$' avoids killing unrelated processes. + pkill -SIGKILL "${PKILL_ECHO_FLAG}" -P $$ "${PROC_NAME}" \ || echo "Nothing to kill: ${PROC_NAME}" done