[Lxc-users] Proposal for an FHS-compliant default guest filesystem location

Trent W. Buck twb at cybersource.com.au
Mon Nov 29 06:15:47 UTC 2010


"Brian K. White" <brian at aljex.com> writes:

> On 11/8/2010 1:14 PM, Michael H. Warfield wrote:
>> On Mon, 2010-11-01 at 08:40 -0500, Serge E. Hallyn wrote:
>>> Quoting Walter Stanish (walter.stanish at saffrondigital.com):
>>>> http://lxc.git.sourceforge.net/git/gitweb.cgi?p=lxc/lxc;a=commitdiff_plain;h=c01d62f21b21ba6c2b8b78ab3c2b37cc8f8fd265
>>>
>>> This commit only moves the location of the 'templates', which are
>>> just scripts that install a guest fs.  It doesn't/shouldn't move
>>> the location of the actual guest fs's.
>>>
>>>> Therefore I humbly propose:
>>>>   - the establishment of /var/lib/lxc as the default top-level
>>>> directory for guest filesystems
>>
>>> AFAICS we are still using /var/cache/lxc right now.  Which I like
>>> better than /var/lib/lxc.  If it has 'lib' in the pathname, it should
>>> have libraries!

In Ubuntu, lxc 0.7.2's lxc-ubuntu places the debootstrap cache in
/var/cache; the rootfs and config in /var/lib/lxc/.  It also ships an
sysvinit init.d job that expects config files in /etc/lxc/<name>.conf.

>> Actually, I would beg to differ with you on that since it's in /var and
>> that's where system applications write and store data.  Libraries
>> (meaning linked libraries, dynamic and static) should be under /usr
>> or /lib since they are not generally written to.

Recall that /var was split out of /usr when Sun made /usr a read-only
NFS mount for netboot hosts.

>> Personally, I like and use /srv/lxc for my VMs and don't see any
>> conflict with the FHS.  It is, after all, a site local configuration
>> sort of thing that gets set up when you build the images and comprises,
>> potentially, entire FHS-like sub hierarchies for the VMs.

It is a Debian policy violation for packages to place files in
/srv.  However, I see no problem with scripts like lxc-ubuntu *by
default* creating rootfs's in /srv/lxc/ post-install, as long as the
sysadmin is allowed to override this (i.e. lxc-ubuntu -p) easily.

This is what I've done for my patched lxc-ubuntu.

> cgroups is another issue.
> /cgroup makes sense because of /proc /sys /dev etc, but there are also
> /dev/pts and /sys/kernel/debug etc so mounting kernel virtual fs's on /
> is not universal.

Upstream cgroup documentation uses /dev/cgroup.  I would appreciate a
udev rules.d file that creates and mounts a cgroup there; I haven't
gotten around to writing one myself.





More information about the lxc-users mailing list