LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Containers (https://www.linuxquestions.org/questions/linux-containers-122/)
-   -   Rootless podman on Slackware / Dependency on persistence of XDG_RUNTIME_DIR between sessions (https://www.linuxquestions.org/questions/linux-containers-122/rootless-podman-on-slackware-dependency-on-persistence-of-xdg_runtime_dir-between-sessions-4175734977/)

mpeterma 03-16-2024 12:59 PM

Rootless podman on Slackware / Dependency on persistence of XDG_RUNTIME_DIR between sessions
 
Hello everyone,

I'm using Slackware 15 as a container runtime for Podman. I'm utilizing Podman with "rootless" containers, meaning processes run from the perspective of a standard user on the host. This setup works great so far, but I have a slight understanding issue.

The Podman command utilizes XDG_RUNTIME_DIR to persist runtime information about running containers. The directory is, for example, /run/user/1000. Here's what I do:

1. SSH login to the host
2. Start a container with Podman: podman start mycontainer
3. List running containers with: podman ps
4. Logout
5. SSH login again
6. List running containers again with: podman ps

As expected, step 3 shows the running containers, but step 6 does not. The cause appears to be that the contents of XDG_RUNTIME_DIR are cleared upon logout. It's worth noting that Slackware uses elogind. Can anyone confirm this and perhaps provide a tip on whether I can change this behavior?

Kind regards
Matthias

mpeterma 03-17-2024 12:36 AM

Good morning, after a good night's sleep and a new attempt at research, I have finally come up with a solution that I would like to share with you. I had already suspected that it had something to do with elogind. elogind is actually the extracted session management functionality from systemd. it therefore offers the same mechanisms and the same tools. i was able to make my desired change with "loginctl". "loginctl enable-linger <username>" ensures that the xdg_runtime_dir remains after a logout. This here helped me much: https://calinradoni.github.io/pages/...n-systemd.html

Kind regards
Matthias


All times are GMT -5. The time now is 07:29 AM.