X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_lxc.py;h=b398448c233fe1055798f40b0b3f74fc4b7c59bd;hb=fccf8b1e3c357c14d6f3229bd0d5c0c48d65e21a;hp=441b2e6e49962b2009f0854d9a51ce5327590f02;hpb=0975227f6b0e10da26c079163299c37e3716d9dc;p=nodemanager.git diff --git a/sliver_lxc.py b/sliver_lxc.py index 441b2e6..b398448 100644 --- a/sliver_lxc.py +++ b/sliver_lxc.py @@ -11,7 +11,7 @@ from string import Template import libvirt import logger -import bwlimitlxc as bwlimit +import plnode.bwlimit as bwlimit from initscript import Initscript from sliver_libvirt import Sliver_Libvirt @@ -90,10 +90,15 @@ class Sliver_LXC(Sliver_Libvirt, Initscript): command = ['chmod', '755', containerDir] logger.log_call(command, timeout=15*60) - # customize prompt for slice owner + # customize prompt for slice owner, + LD_PRELOAD for transparently wrap bind dot_profile=os.path.join(containerDir,"root/.profile") + ld_preload_msg="""# by default, we define this setting so that calls to bind(2), +# when invoked on 0.0.0.0, get transparently redirected to the public interface of this node +# see https://svn.planet-lab.org/wiki/LxcPortForwarding""" with open(dot_profile,'w') as f: f.write("export PS1='%s@\H \$ '\n"%(name)) + f.write("%s\n"%ld_preload_msg) + f.write("export LD_PRELOAD=/etc/planetlab/lib/bind_public.so\n") # TODO: set quotas...