From a605a1e7f503d977adb47d7549efdca2b524fcb2 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Thu, 15 Aug 2013 17:06:26 -0700 Subject: [PATCH] remove unnecessary proc remounts, prevent setting LD_PRELOAD if the library doesn't exist in image --- lxcsu | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) mode change 100755 => 100644 lxcsu diff --git a/lxcsu b/lxcsu old mode 100755 new mode 100644 index 9880360..26c1e9d --- a/lxcsu +++ b/lxcsu @@ -180,9 +180,7 @@ def main (): for (sysctl_file, sysctl_name, sysctl_val) in sysctls: for fn in ["/sbin/sysctl", "/usr/sbin/sysctl", "/bin/sysctl", "/usr/bin/sysctl"]: if os.path.exists(fn): - os.system("mount -o remount,rw none /proc/sys") os.system('%s -w %s=%s'%(fn, sysctl_name,sysctl_val)) - os.system("mount -o remount,ro none /proc/sys") break else: print "Error: image does not have a sysctl binary" @@ -243,7 +241,8 @@ def main (): os.environ['SHELL'] = '/bin/sh' os.environ['HOME'] = '/home/%s'%slice_name - os.environ['LD_PRELOAD'] = '/etc/planetlab/lib/bind_public.so' + if os.path.exists('/etc/planetlab/lib/bind_public.so'): + os.environ['LD_PRELOAD'] = '/etc/planetlab/lib/bind_public.so' os.chdir("/home/%s"%(slice_name)) if debug: print 'lxcsu:execv:','/usr/bin/setarch',exec_args os.execv('/usr/bin/setarch',exec_args) -- 2.43.0