[lxc-devel] [PATCH 2/3] execute: bind init.lxc.static into container

Serge Hallyn serge.hallyn at ubuntu.com
Tue May 20 18:54:18 UTC 2014


Quoting Serge Hallyn (serge.hallyn at ubuntu.com):
> Quoting Serge Hallyn (serge.hallyn at ubuntu.com):
> > Quoting Stéphane Graber (stgraber at ubuntu.com):
> > > On Mon, May 19, 2014 at 03:51:28PM +0000, Serge Hallyn wrote:
> > > > Quoting Stéphane Graber (stgraber at ubuntu.com):
> > > > > On Mon, May 12, 2014 at 06:04:00PM +0000, Serge Hallyn wrote:
> > > > > > Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
> > > > > 
> > > > > So one concern here is that SBINDIR may be pretty much anything and may
> > > > > look pretty awkward in the container, can we have the bind-mount be done
> > > > > with say /lxc.init.static instead and only be done in the last resort
> > > > > case where an existing init couldn't be found?
> > > > 
> > > > Sure, that sounds good.
> > > 
> > > Your new patch does put it in /lxc.init.static but still appears to do
> > > it in all cases (even if it ends up unused). I'd really prefer we only
> > > do the bind-mount if we can't detect a suitable init in the rootfs and
> > > also remove the bind-mounted file from the rootfs on exit (at least in
> > > the non-error path).
> > > 
> > > I'd really like us to make sure that when you use lxc, either for a full
> > > fledged container or just for an application container that the rootfs
> > > is restored to the way it was when the container exits. That means
> > > removing the bind-mount target in this case, restoring the original
> > > tty/console nodes, ...
> > 
> > Ok - that should be a pretty simple matter of splitting most of
> > choose_init() into a separate detect_init() which is re-used before
> > we create the lxc.init.static bind mount.  I won't get to that today
> > so if anyone wants to feel free.
> 
> Ok I lied.  Here is a patch doing that.
> 
> However, during testing I found that I guess I'd been test-building without
> cgmanager before.  When compiling with libcgmanager, configure is
> putting -lcgmanager into the global LIBS, and trying to statically link

Feh this is because of

AC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1])

which adds the found lib to LIBS, unlike other helpers which only do so as an
overridable default action.


More information about the lxc-devel mailing list