[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#775318: debian-policy: Using /srv instead of /var/lib for served user-level data



Afif Elghraoui <afif.elghraoui@openmailbox.org> writes:

> I wanted to separate user-level data (for special RAID, backups,
> encryption and such) from system data on my machine, so I targeted /home
> and /srv. I found out that data managed by system services are being
> stored in /var/lib/<packagename> when I expected them to be in /srv and
> this doesn't really make sense to me. I also wanted to limit the size of
> the /var partition to around 4GB, but I can't practically do this when,
> for example, ownCloud is managing user's data in
> /var/lib/owncloud. Users would then see a file storage limit of whatever
> space there was left in /var. Dokuwiki, mediawiki, and I believe gitweb
> are other examples.

> I don't think this is just a personal preference on my part, since the
> FHS doesn't seem to describe this kind of use for /var while /srv makes
> more sense
> /var/lib --
> http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBVARIABLESTATEINFORMATION
> /srv --
> http://www.pathname.com/fhs/pub/fhs-2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM

I'm afraid that you're misreading the FHS.  It actually *prohibits* the
distribution from doing what you want and using /srv by default.

This is the important part of the /srv description for this purpose:

    The methodology used to name subdirectories of /srv is unspecified as
    there is currently no consensus on how this should be done. One method
    for structuring data under /srv is by protocol, eg. ftp, rsync, www,
    and cvs. On large systems it can be useful to structure /srv by
    administrative context, such as /srv/physics/www, /srv/compsci/cvs,
    etc. This setup will differ from host to host. Therefore, no program
    should rely on a specific subdirectory structure of /srv existing or
    data necessarily being stored in /srv.

In other words, we're not allowed to assume any particular directory
structure under /srv (which would be necessary to configure packages to
use it by default), and are not allowed to use /srv without your (the
administrator's) explicit permission.  For anything that packages need to
use out of the box, /var is the correct file system:

    /var contains variable data files. This includes spool directories and
    files, administrative and logging data, and transient and temporary
    files.

Such things as databases are variable data files.  Packages are certainly
allowed to put them under /srv if you've explicitly configured them to do
so, and hence expressed the file structure that you want to use, but we
can't assume that.

/srv exists for you to structure however you like, and then explicitly
configure packages to use if you choose.  /var is the default data store
for everything, and where everything goes unless you explicitly configure
it otherwise.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: