Skip to content
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

Respect XDG base directory #10529

Open
docabci opened this issue Jul 16, 2024 · 3 comments
Open

Respect XDG base directory #10529

docabci opened this issue Jul 16, 2024 · 3 comments
Milestone

Comments

@docabci
Copy link

docabci commented Jul 16, 2024

k3s use $HOME/.rancher/k3s as data dir.

It should be $XDG_DATA_HOME/rancher/k3s with $HOME/.local/rancher/k3s if XDG_DATA_HOME is not defined.

https://wiki.archlinux.org/title/XDG_Base_Directory

@brandond
Copy link
Contributor

brandond commented Jul 16, 2024

Can you provide a list of which distros set this, and why we would want to support it over $HOME? I'm not aware of it being set on any of the distros we currently test on or support.

@docabci
Copy link
Author

docabci commented Jul 16, 2024

The basedir spec is for applications not distros. The idea is :

  • to avoid having everything at $HOME top level folder ;
  • to let users relocate configuration, runtime data...

Distros like Debian or Arch Linux generally ask upstream project to implements this rather than patching it.

@brandond
Copy link
Contributor

Huh, interesting. I see other XDG env vars (such as XDG_RUNTIME_DIR) set on my session, but not XDG_DATA_HOME; I was naively expecting it to be set to an appropriate default on distros that encourage its use.

I would worry about this being a breaking change, we would probably want to check for the current default and continue to use that if it exists, in case anyone is currently running k3s out of $HOME.

@brandond brandond added this to the Backlog milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: Accepted
Development

No branches or pull requests

2 participants