Re: Cleaning of $XDG_CACHE_HOME and $XDG_CACHE_HOME/thumbnails

Benjamin Berg <[email protected]>
Newsgroups gmane.linux.xdg.devel
Message-ID <[email protected]>
Hi,

So, lets try to clarify a few points.


I do think that it is a good idea to use tmpfiles.d and for
applications to ship appropriate configurations. There seems to be an
overall agreement that tmpfiles.d is an appropriate way of doing this
and that we could standardise on it.

The strong argument in favour is that we have an external service that
guarantees cleanup even if the application is not running regularly.
For example, I have multiple .cache/* directories with relevant amounts
of junk data for applications that I have not used in months to years.


But, I would like to go one step further and make this an opt-out.
Which is what appears to be triggering the opposition here. The
argument in favour is a bit more complicated, but I think it boils down
to:

 * The behaviour becomes explicit rather than an implicit "keep
   forever" policy. I do feel that this is really good in principle.
 * In principle, I don't think it is sane to keep caches forever. So I
   do believe it makes sense to define the expectation that
   $XDG_CACHE_HOME is cleaned eventually even if the application is not
   run regularly.
 * If a user just stops using an application and removes the package,
   then we should clean the cache. This works very nicely with an opt-
   out solution, as the tmpfiles.d config is removed and the default
   configuration kicks in and cleans things up.

And yes, I do agree that it may well be a bit painful at the point when
the switch is flipped. I wouldn't expect that to happen for another 1-2 
years after the specification changed though; and I expect that some
distributions would play safe und would wait even longer.

So yeah, I don't feel that sticking to the status-quo of never deleting
application caches is sane. I am happy to reconsider my position. But I
really don't find it a very convincing counter argument that the
transition may be painful in a few cases.

Benjamin

On Wed, 2020-02-26 at 13:45 +0100, Benjamin Berg wrote:
> Hi,
> 
> so I looked at gsd-housekeeping the other day. With systemd-
> tempfiles,
> it only has two purposes these days:
> 
>  1. Cleaning $XDG_CACHE_HOME/thumbnails after 30 days
>  2. Cleaning the trash directories after a configurable time
> 
> Currently it also tries to clean /tmp and /var/tmp, but doing so is
> really dangerous compared to just leaving it up to systemd-tempfiles
> (I
> have filed an MR to disable the logic if we are systemd booted).
> 
> 
> Now, systemd-tempfiles can already clean up everything except for the
> trash. And considering that $XDG_CACHE_HOME is non-essential by
> definition, I think it might be sane to use systemd-tempfiles not
> only
> to clean the thumbnails but the entirety of $XDG_CACHE_HOME in the
> future. So I am thinking that we could do the following:
> 
>    1. Specify that we use the systemd tmpfiles.d configuration format
> for
>       cleaning $XDG_CACHE_HOME. Also specify that $XDG_CACHE_HOME
> will be
>       cleaned automatically after e.g. 30 days unless otherwise
> configured
>       by an application.
>    2. Add some reference to this to the thumbnail specification.
>    3. Tell application maintainers that they need to ship a
> configuration
>       if they want to keep files longer (likely candidates are e.g.
> email
>       clients).
>    4. As a start, add a "xdg-thumbnails.conf" systemd-tempfiles
>       configuration to systemd that cleans $XDG_CACHE_HOME/thumbnails
>       after 30 days.
>    5. After a grace period, add "xdg-cache.conf" to clean
> $XDG_CACHE_HOME
>       and remove "xdg-thumbnails.conf" again (similar to how
>       /usr/lib/tmpfiles.d/tmp.conf does it for /var/tmp and /tmp)
> 
> Is it reasonable to standardise on the systemd tmpfiles.d format?
> Is it OK to clean $XDG_CACHE_HOME after a fixed time period by
> default?
> Other thoughts?
> 
> Benjamin
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> xdg mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/xdg

_______________________________________________
xdg mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xdg
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEED2NO4vMS33W8E4AFq6ZWhpmFY3AFAl5WqG4ACgkQq6ZWhpmF
Y3CbMg/6A9miSvrqHUhRDx3oC0tSoWPCfPuzRQvIWLCvG/luFdBz9tngjPEM88m0
9e8xQgugJiLnuuY69Bcp4Lvbw59XuHVLM5tSoZsgmRVaXkfMR102WTTAJc9G94Vr
Iv9jGUqWkbN/OesKgpk2RQNCKtAcppaeWXZZkRQnIUc9PwgHFswRyxTEzMkIDrET
NFDihvQhiHk944OANSxUUmpx+iE7HxiOFLt2EbCH3REpg2UU3ryxzYv1xZnswUe0
8BlF84uqXJd9iveh29H1SoS3inTGH9mF/pKfl6R0NYsQYz78i7DO7fxdHEjWMnHC
EZv1goxRz93jlYtBIo6CiYyjCa8KpqupLFxzA+CPI+uiehDmhD67CBYaAqL2IhDq
HtSQSgvnho4vO48628eLLpKL8DsISFmKfh4515Hb8XL2T6Vz6uChoHdHGyMW19Wg
1T+ansJbZK80YSBg9UOW0rVWZYIwdiQ9m6eO+X1LM4MNXVNX/J+utI5EXQc1N6dE
Ip6EOs3lQmewV+jFiBrgVhxskoWe3KPFH/OtCqy6e72ra39jGsHssN+ASTflLGVj
chM4A1RR1M3hS5BKGGFZTRGSxLxMgZ0a+3RhqRh+d4NTvyobtBhQiG68dk08IcHx
B5GkGa4Tu1dxUw14OI+Wtflrbmoep63fT4VjRj1AR1keHTf+q2o=
=/3gs
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.