From e16c5fe905c940d81466f704cccd5e31601eb237 Mon Sep 17 00:00:00 2001
From: cody burkard <cody@onlab.us>
Date: Thu, 25 Sep 2014 18:39:54 -0700
Subject: [PATCH] attach to cgroup first, then mount namespace

---
 mininet/node.py | 4 ++--
 util/m          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mininet/node.py b/mininet/node.py
index 949e7678..0e2051ef 100644
--- a/mininet/node.py
+++ b/mininet/node.py
@@ -653,8 +653,8 @@ 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', '-da', str( self.pid ),
-                  '-g', self.name ]
+        mncmd = [ 'mnexec', '-g', self.name,
+                  '-da', str( self.pid ) ]
         if self.sched == 'rt':
             mncmd += [ '-r', str( self.rtprio ) ]
         return Host.popen( self, *args, mncmd=mncmd, **kwargs )
diff --git a/util/m b/util/m
index 860eeb05..f3b8ce55 100755
--- a/util/m
+++ b/util/m
@@ -40,5 +40,5 @@ if [ -d $rootdir -a -x $rootdir/bin/bash ]; then
     cmd="chroot $rootdir /bin/bash -c $cmd"
 fi
 
-cmd="exec sudo mnexec -a $pid $cg $cmd"
+cmd="exec sudo mnexec $cg -a $pid $cmd"
 eval $cmd
-- 
GitLab