Merge pull request #391 from cdburkard/patches/fix_popen

workaround: attach to cgroup first, then mount namespace
This commit is contained in:
lantz
2014-09-26 16:47:06 -07:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -653,8 +653,8 @@ class CPULimitedHost( Host ):
args: Popen() args, single list, or string args: Popen() args, single list, or string
kwargs: Popen() keyword args""" kwargs: Popen() keyword args"""
# Tell mnexec to execute command in our cgroup # Tell mnexec to execute command in our cgroup
mncmd = [ 'mnexec', '-da', str( self.pid ), mncmd = [ 'mnexec', '-g', self.name,
'-g', self.name ] '-da', str( self.pid ) ]
if self.sched == 'rt': if self.sched == 'rt':
mncmd += [ '-r', str( self.rtprio ) ] mncmd += [ '-r', str( self.rtprio ) ]
return Host.popen( self, *args, mncmd=mncmd, **kwargs ) return Host.popen( self, *args, mncmd=mncmd, **kwargs )
+1 -1
View File
@@ -40,5 +40,5 @@ if [ -d $rootdir -a -x $rootdir/bin/bash ]; then
cmd="chroot $rootdir /bin/bash -c $cmd" cmd="chroot $rootdir /bin/bash -c $cmd"
fi fi
cmd="exec sudo mnexec -a $pid $cg $cmd" cmd="exec sudo mnexec $cg -a $pid $cmd"
eval $cmd eval $cmd