[systemd-devel] [Lxc-users] Unable to run systemd in an LXC / cgroup container.

Serge Hallyn serge.hallyn at canonical.com
Thu Oct 25 12:02:21 PDT 2012


Quoting Michael H. Warfield (mhw at WittsEnd.com):
> On Thu, 2012-10-25 at 13:23 -0400, Michael H. Warfield wrote:
> > Hey Serge,
> > 
> > On Thu, 2012-10-25 at 11:19 -0500, Serge Hallyn wrote:
> 
> ...
> 
> > > Oh, sorry - I take back that suggestion :)
> > 
> > > Note that we have mount hooks, so templates could install a mount hook to
> > > mount a tmpfs onto /dev and populate it.
> > 
> > Ok...  I've done some cursory search and turned up nothing but some
> > comments about "pre mount hooks".  Where is the documentation about this
> > feature and how I might use / implement it?  Some examples would
> > probably suffice.  Is there a require release version of lxc-utils?
> 
> I think I found what I needed in the changelog here:
> 
> http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg01490.html
> 
> I'll play with it and report back.

Also the "Lifecycle management hooks" section in
https://help.ubuntu.com/12.10/serverguide/lxc.html

Note that I'm thinking that having lxc-start guess how to fill in /dev
is wrong, because different distros and even different releases of the
same distros have different expectations.  For instance ubuntu lucid
wants /dev/shm to be a directory, while precise+ wants a symlink.  So
somehow the template should get involved, be it by adding a hook, or
simply specifying a configuration file which lxc uses internally to
decide how to create /dev.

Personally I'd prefer if /dev were always populated by the templates,
and containers (i.e. userspace) didn't mount a fresh tmpfs for /dev.
But that does complicate userspace, and we've seen it in debian/ubuntu
as well (i.e. at certain package upgrades which rely on /dev being
cleared after a reboot).

-serge


More information about the systemd-devel mailing list