From e5a15ced017f8a44f3f6298ffe2e12a6952fc8e9 Mon Sep 17 00:00:00 2001
From: Bob Lantz <rlantz@cs.stanford.edu>
Date: Thu, 28 Mar 2013 18:14:24 -0700
Subject: [PATCH] Change popen() to detach from terminal/process group. This
 may or may not be the right thing to do - an alternative would be to ignore
 SIGINT, but that would make the popen() job unkillable by normal means! So
 we'll try this and see how well it works. Fixes #124

---
 mininet/node.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mininet/node.py b/mininet/node.py
index 6275f0cb..fc24ad21 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -291,7 +291,7 @@ def popen( self, *args, **kwargs ):
            kwargs: Popen() keyword args"""
         defaults = { 'stdout': PIPE, 'stderr': PIPE,
                      'mncmd':
-                     [ 'mnexec', '-a', str( self.pid ) ] }
+                     [ 'mnexec', '-da', str( self.pid ) ] }
         defaults.update( kwargs )
         if len( args ) == 1:
             if type( args[ 0 ] ) is list:
@@ -605,7 +605,7 @@ def popen( self, *args, **kwargs ):
            args: Popen() args, single list, or string
            kwargs: Popen() keyword args"""
         # Tell mnexec to execute command in our cgroup
-        mncmd = [ 'mnexec', '-a', str( self.pid ),
+        mncmd = [ 'mnexec', '-da', str( self.pid ),
                   '-g', self.name ]
         if self.sched == 'rt':
             mncmd += [ '-r', str( self.rtprio ) ]
-- 
GitLab