Skip to content

Value of $XDG_RUNTIME_DIR persists across reboots #28467

@WhyNotHugo

Description

@WhyNotHugo

Issue Description

Previously, XDG_RUNTIME_DIR=/run/user-1000.

My system setup has changed, and after a reboot, XDG_RUNTIME_DIR points to a different location.

podman seems to have persisted the value of XDG_RUNTIME_DIR somewhere, and now fails, because it's trying to access a path which no longer exists:

> podman ps
WARN[0000] RunRoot is pointing to a path (/run/user-1000/containers) which is not writable. Most likely podman will fail. 
Error: creating events dirs: mkdir /run/user-1000: permission denied

Note that the value of XDG_RUNTIME_DIR has been stable since the system rebooted: the value that podman is using was only ever exposed before the system went offline.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Set XDG_RUNTIME_DIR to some value.
  2. podman run … (any container)
  3. Reconfigure the system so that the next boot uses a different XDG_RUNTIME_DIR (e.g.: by changing the system component that initialises it).
  4. Reboot
  5. podman ps

Describe the results you received

Podman tries to access a path based on an environment variable's value from a previous boot.

Describe the results you expected

Podman should not cache environment variables or values derived from them; it should read the current XDG_RUNTIME_DIR.

podman info output

Podman 5.8.1-r1, on Alpine Linux.

> podman info
WARN[0000] RunRoot is pointing to a path (/run/user-1000/containers) which is not writable. Most likely podman will fail. 
Error: creating events dirs: mkdir /run/user-1000: permission denied

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions