Setting tag lxc-userspace-1.0-1
[lxc-userspace.git] / lxcsu
diff --git a/lxcsu b/lxcsu
index 83f1144..164344f 100755 (executable)
--- a/lxcsu
+++ b/lxcsu
@@ -136,10 +136,13 @@ def main ():
         setns.chcontext('/proc/%s/ns/net'%pid)
 
     if (not options.mntns):
-        open('/proc/lxcsu','w').write(pid)
+        setns.chcontext('/proc/%s/ns/mnt'%pid)
 
     if (not options.pidns):
-        open('/proc/pidsu','w').write(pid)
+        setns.chcontext('/proc/%s/ns/pid'%pid)
+
+    if (not os.access('/proc/self',0)):
+        setns.proc_mount()
 
     # cgroups is not yet LXC-safe, so we need to use the course grained access control
     # strategy of unmounting the filesystem