Skip to content

Commit

Permalink
Killing parent before child
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Jan 25, 2025
1 parent ad450b6 commit 61a123f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ function lap_measurement {

function kill_tree() {
for parent_pid in "$@"; do
kill -SIGTERM $parent_pid 2>/dev/null || true;
local child_pids=$(pgrep -P $parent_pid)
kill -SIGTERM $parent_pid 2>/dev/null || true;
for child_pid in $child_pids; do
kill_tree $child_pid
done
Expand Down

0 comments on commit 61a123f

Please sign in to comment.