-
-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daemon socket should be in $XDG_RUNTIME_DIR #2153
Comments
I run into the same issue when preparing atuin daemon support on Gentoo.
Not only when this variable (XDG_RUNTIME_DIR) is available. Even in the absence of XDG_RUNTIME_DIR from the processes' environment, atuin should default to that. The "XDG Base Directory Specification" is states that
Source: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables So atuin's default for |
When it falls back to If the directory doesn't exist, one can next attempt to create a temporary directory in Another thing to care is a known bug of WSL. In WSL systems, one should avoid using
|
Due to this additional complication in following that part of the spec, my PR doesn't fallback to it. It's also not theoretical, as we checked Alpine and it does not have this path. If the var exists, we use it, and if it doesn't, we don't. The var is automatically set by systemd, and points to a directory that has been correctly setup. Creating and managing such a dir is very out of scope for Atuin. Afaik we have no way of detecting WSL, and if that becomes an issue users can specify a different directory. I'm afraid "just follow XDG" is never as easy as it sounds. |
The canonical location for user service sockets (and other runtime temporary files) on systemd systems is
$XDG_RUNTIME_DIR
(typically/run/user/$UID
). When this variable is available, Atuin should locate its daemon socket at$XDG_RUNTIME_DIR/atuin/atuin.sock
by default.The text was updated successfully, but these errors were encountered: