The XDG_RUNTIME_DIR environment variable is not always set. It is
mostly used by Linux distributions that use systemd; others may or may
not use it.
There is no general consensus on the appropriate location for sockets,
pipes, PID files, etc. in the absence of a specified runtime directory.
Historically, applications would create a "dot directory" (e.g.
~/.gnupg) and store all of their files there. Some applications,
including libvirt and gnome-keyring, use the cache directory, while
others (e.g. many Electron-based applications) store everything in the
configuration directory. Finally, there is the age-old tradition of
putting everything in /tmp.
This commit adds fallback logic anywhere the runtime directory is used.
If the runtime directory is not configured, the cache directory is used
in its place.
The
XDG_RUNTIME_DIR
environment variable is not always set. It is mostly used by Linux distributions that use systemd; others may or may not use it.There is no general consensus on the appropriate location for sockets, pipes, PID files, etc. in the absence of a specified runtime directory. Historically, applications would create a "dot directory" (e.g.
~/.gnupg
) and store all of their files there. Some applications, including libvirt and gnome-keyring, use the cache directory, while others (e.g. many Electron-based applications) store everything in the configuration directory. Finally, there is the age-old tradition of putting everything in/tmp
.This commit adds fallback logic anywhere the runtime directory is used. If the runtime directory is not configured, the cache directory is used in its place.
Fixes #3