From 01be80aa1f138419090621cc2d64f6b6b6a53534 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 18 Dec 2009 22:05:58 +0000 Subject: [PATCH] Make sure the new process has its net namespace unshared. --- exec/{run_with_devices.pl => run_with_devices.py} | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) rename exec/{run_with_devices.pl => run_with_devices.py} (87%) diff --git a/exec/run_with_devices.pl b/exec/run_with_devices.py similarity index 87% rename from exec/run_with_devices.pl rename to exec/run_with_devices.py index 17132c4..c0b2312 100644 --- a/exec/run_with_devices.pl +++ b/exec/run_with_devices.py @@ -42,7 +42,15 @@ if (pid): args = [slicename] args += ['exec'] args += [command_name] - os.execve(vserver_command, args) + + os.system('touch /etc/vservers/%s/spaces/net'%slicename) + + try: + os.execve(vserver_command, args) + except: + pass + + os.system('rm /etc/vservers/%s/spaces/net'%slicename) else: for vif in device_names: os.system('/sbin/ip link set %s netns %d'%(vif, pid)) -- 2.43.0