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

Handling Env for Headless Dev / with user session | Support inference of XDG_RUNTIME_DIR #1465

Open
ehdis opened this issue Mar 5, 2024 · 0 comments
Labels
1. Bug Something isn't working

Comments

@ehdis
Copy link

ehdis commented Mar 5, 2024

Describe the bug
Steps how to reproduce the behaviour

Env for Headless Dev / with user session

The creation of the container fails

[root@tbx ~]# useradd test
[root@tbx ~]# passwd test
[root@tbx ~]# loginctl enable-linger $(id -u test)
[root@tbx ~]# su - test
[test@tbx ~]$ toolbox create --distro fedora -r 39
Image required to create toolbox container.
Download registry.fedoraproject.org/fedora-toolbox:39 (500MB)? [y/N]: y
Error: failed to create container fedora-toolbox-39
[test@tbx ~]$ echo $?
1

Expected behaviour
A container in $ podman ps -a

Actual behaviour
Empty $ podman ps -a output.

Output of toolbox --version (v0.0.90+)
toolbox version 0.0.99.4

Toolbx package info (rpm -q toolbox)
toolbox-0.0.99.4-6.el9_3.x86_64

Additional context
The user manager (systemd session) is spawned for the user at boot but the XDG_RUNTIME_DIR is not set.

[test@tbx ~]$ printenv |grep ^XDG_R || echo "No env"
No env

albeit

[test@tbx ~]$ test -S /run/user/$(id -u)/bus && echo "Socket available"
Socket available

Should toolbx infer the environment var (via socket availability)?

The empty XDG_RUNTIME_DIR is the cause for the failed creation of the container. When setting it the process runs ...

[test@tbx ~]$ export XDG_RUNTIME_DIR=/run/user/$(id -u "${USER}")
[test@tbx ~]$  toolbox create --distro fedora -r 39
Created container: fedora-toolbox-39
Enter with: toolbox enter fedora-toolbox-39
[test@tbx ~]$ echo $?
0
@ehdis ehdis added the 1. Bug Something isn't working label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant