summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/scripts/netjail/netjail_core.sh9
-rwxr-xr-xcontrib/scripts/netjail/netjail_setup_internet.sh2
2 files changed, 10 insertions, 1 deletions
diff --git a/contrib/scripts/netjail/netjail_core.sh b/contrib/scripts/netjail/netjail_core.sh
index 8dbbeacf1..a3271a3e4 100755
--- a/contrib/scripts/netjail/netjail_core.sh
+++ b/contrib/scripts/netjail/netjail_core.sh
@@ -126,4 +126,13 @@ netjail_node_exec() {
unshare -fp --kill-child -- ip netns exec $NODE sudo -u $JAILOR -- $@ 1>& $FD_OUT 0<& $FD_IN
}
+netjail_kill() {
+ PID=$1
+
+ for CHILD in $(ps -o pid,ppid -ax | awk "{ if ( \$2 == $PID ) { print \$1 } }"); do
+ netjail_kill $CHILD
+ done
+
+ kill $PID
+}
diff --git a/contrib/scripts/netjail/netjail_setup_internet.sh b/contrib/scripts/netjail/netjail_setup_internet.sh
index 2d448168a..94aec007e 100755
--- a/contrib/scripts/netjail/netjail_setup_internet.sh
+++ b/contrib/scripts/netjail/netjail_setup_internet.sh
@@ -86,7 +86,7 @@ for N in $(seq $GLOBAL_N); do
done
for PID in $WAITING; do wait $PID; done
-for PID in $KILLING; do kill $PID; done
+for PID in $KILLING; do netjail_kill $PID; done
wait
if [ $STUN -gt 0 ]; then