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

Walter Stanish walter.stanish at saffrondigital.com
Tue Nov 2 03:04:04 UTC 2010


> > 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.

Hrrm interesting, I haven't seen that come through on my
distribution's packages (gentoo).
Quick survey - what paths are other distributions encouraging their
users to put guest root filesystems in?

> Which I like better than /var/lib/lxc.  If it has 'lib' in the pathname, it should have libraries!

I'm not certain about that:  /var/lib/mysql has been the default for
MySQL databases, forever.

The FHS v2.3 (p33) states that /var/lib is for "variable state information" and
"An application (or a group of inter-related applications) must use a
subdirectory of /var/lib for its data. There is one required
subdirectory, /var/lib/misc, which is intended for state files that
don’t need a subdirectory; the other subdirectories should only be
present if the application in question is included in the
distribution.  /var/lib/<name> is the location that must be used for
all distribution packaging support."

Here's what the FHS v2.3 (p31) doc says about /var/cache :
'Application cache data':
"/var/cache is intended for cached data from applications. Such data
is locally generated as a result of time-consuming I/O or calculation.
The application must be able to regenerate or restore the data. Unlike
/var/spool, the cached files can be deleted without data loss. The
data must remain valid between invocations
of the application and rebooting the system.
Files located under /var/cache may be expired in an application
specific manner, by the system administrator, or both. The application
must always be able to recover from manual deletion of these files
(generally because of a disk space shortage). No other requirements
are made on the data format of the cache directories."

Basically /var/cache seems to be the wrong place for this type of data.

My vote is still for /var/lib instead of /var/cache.

> >  - all use of /etc/lxc/<guestname>/rootfs should be considered deprecated
> I don't see that being used on my system, or in the git commit you cited.

As per the example given in the previous post, I believe it's used in
some of the template scripts.
(Also I have a feeling it may be referenced in some
distribution-specific documentation or packages, though I'm not sure
exactly which/where.)

Again, thanks a lot to all for great software :)

- Walter




More information about the lxc-users mailing list