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

/run/user/$UID as fallback if XDG_RUNTIME_DIR is not set #475

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

eighthave
Copy link
Contributor

@eighthave eighthave commented Nov 28, 2024

XDG mentions /run/user/$UID as the value for XDG_RUNTIME_DIR:

Archlinux, Debian, RedHat, Ubuntu, etc all use /run/user/$UID because they follow XDG:

I found this while using podman-py on a minimal headless Debian server setup, where /run/user/$UID was in use but XDG_RUNTIME_DIR was not set. The existing fallback in /tmp did not work.

Copy link
Contributor

@inknos inknos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your changes. All makes sense to me. I would like to get all green checks in our automation before approving.

please address my comment and also check your commit summary. it contains long links that you can split so the checker won't complain that are longer than 72 characters. for me it's fine to split the urls even if they won't be clickable.

once the tests pass we can give this PR a go! :)

feel free to ask if you have more questions or if you want to design a test for your use case that would be awesome

podman/api/path_utils.py Outdated Show resolved Hide resolved
@eighthave eighthave changed the title /run/user/$UID as fallback path if XDG_RUNTIME_DIR is not set /run/user/$UID as fallback if XDG_RUNTIME_DIR is not set Nov 29, 2024
XDG mentions `/run/user/$UID` as the value for `XDG_RUNTIME_DIR`:
https://www.freedesktop.org/software/systemd/man/latest/pam_systemd.html
https://serverfault.com/questions/388840/good-default-for-xdg-runtime-di
r/727994#727994

Archlinux, Debian, RedHat, Ubuntu, etc all use `/run/user/$UID`
because they follow XDG:
https://wiki.archlinux.org/title/XDG_Base_Directory

Signed-off-by: Hans-Christoph Steiner <[email protected]>
@eighthave
Copy link
Contributor Author

I added two unit tests and addressed all the requested changes. And the tests all pass now.

@inknos
Copy link
Contributor

inknos commented Nov 29, 2024

Thanks @eighthave

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Nov 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eighthave, inknos

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 367bce6 into containers:main Nov 29, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants