On Wed, Feb 27, 2019 at 08:13:52AM +0100, Ansgar wrote:
> Josh Triplett writes:
> > diff --git a/policy/ch-files.rst b/policy/ch-files.rst
> > index 48410be..1cdcb18 100644
> > --- a/policy/ch-files.rst
> > +++ b/policy/ch-files.rst
> > @@ -722,6 +722,15 @@ The name of the files and directories installed by 
> > binary packages
> >  outside the system PATH must be encoded in UTF-8 and should be
> >  restricted to ASCII when it is possible to do so.
> >
> > +.. _s-cache:
> > +
> > +Cache
> > +-----
> > +
> > +Packages must not install files or directories into ``/var/cache``. The
> > +system administrator may delete any or all files from this directory at
> > +any time, or may choose to put it on an ephemeral filesystem.
> > +
>
> If you allow directories to be removed at any time, it breaks non-root
> programs using /var/cache: they cannot recreate them.  The FHS only
> allows removing files.
>
> Creating the directories in maintainer scripts instead of shipping them
> in the package makes no difference: if you care about ephemeral
> filesystems for /var/cache, you have to require something like tmpfiles
> or CacheDirectory= in .service files to be used (depending on the
> requirements of the package).
>
> So I think we should require such solutions to be used over just
> forbidding to ship the directory as part of the package.

I don't think we should require any *specific* solution to be used, but
if you'd like, I could certainly say something like "if the package
expects to have a specific directory writable by non-root, it will need
to arrange to create that directory as root before running; the package
should not fail to run if that directory does not exist".

Reply via email to