Bug#920692: [PATCH] Packages must not install files or directories into /var/cache
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.
Ansgar
Reply to: