gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -corrected sub-process cleanup for netja


From: gnunet
Subject: [gnunet] branch master updated: -corrected sub-process cleanup for netjail
Date: Sun, 02 May 2021 22:02:46 +0200

This is an automated email from the git hooks/post-receive script.

thejackimonster pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new ae33e8ca0 -corrected sub-process cleanup for netjail
ae33e8ca0 is described below

commit ae33e8ca07ba8cb72d9823b5137aeeb93bd2056c
Author: TheJackiMonster <thejackimonster@gmail.com>
AuthorDate: Sun May 2 22:00:28 2021 +0200

    -corrected sub-process cleanup for netjail
    
    Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
---
 contrib/scripts/netjail/netjail_core.sh           | 9 +++++++++
 contrib/scripts/netjail/netjail_setup_internet.sh | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

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

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]