Re: Where to set XDG_CACHE_HOME?
René J.V. Bertin <[email protected]> Sat, 28 Feb 2026 15:27:05 +0100
| Newsgroups | gmane.comp.kde.general |
|---|---|
| Message-ID | <4422855.DihjACsKqF@bola> |
On Saturday February 28 2026 10:54:53 Marek Gre=C5=A1ko wrote:
>Do you have any clue where should be the script run from to be started=
soon enough I do not have the $HOME/.cache/mesa_shader_cache created?
Could you do a "bind mount" of ${CACHEDIR}/.cache onto ${HOME}/.cache ?=
I have a comparable set-up where home dirs are on a "safe" ZFS dataset =
(copies=3D2 or a pool with mirrored vdevs) but I don't want the costly =
safety for cache directories. Rather than giving each user a dedicated =
dataset for that, I have a single one with a directory structure that g=
ives each user a .cache directory. The bind mounts are defined in /etc/=
fstab, and triggered via /etc/rc.local once I'm certain all datasets ha=
ve been mounted.
You could probably also just make each ${HOME}/.cache a symlink to your=
local target location. I've done that for a long time, and the only ad=
vantage of bind mounts is that normalised (aka canonical) paths (as obt=
ained e.g. via `realpath`) will still be of the form ${HOME}/.cache . T=
he advantage of symlinks is that you only set them up once without havi=
ng to modify system scripts/tables on each machine where the users migh=
t log in. You'd be relying on users not replacing the symlink ... but i=
f they do it's mostly their problem, no? ;)
In either case, you may run into problems with applications that e.g. d=
ownload something to the cache area, and then "move" it into place with=
system calls like rename(2) that don't do cross-mount operations. I've=
seen both Chromium and Firefox fail to install/update extensions becau=
se of this kind of situation they hadn't foreseen (though it was probab=
ly not related to the cache area).