#29838·podman

Support per-user rootless Quadlets by username: /etc/containers/systemd/user/<username>

Author: traylenatorCreated Sep 25, 2026Updated Sep 29, 2026
Labelskind/featurequadlet

Feature request description

Rootless Quadlets can be restricted to a single user by placing them in /etc/containers/systemd/users/<UID>/. Configuration management tools such as Puppet and Ansible, and image builds such as bootc Containerfiles, usually know the target user by name, not by UID. The UID may not even exist yet when the configuration is compiled or the image is built.

The obvious workaround, /etc/containers/systemd/users/<username>/, silently does the wrong thing. The generator walks users/ recursively and only skips numeric subdirectories, so a username directory is treated as an "all users" unit directory. The units appear to work for the intended user, but they are also generated and started for every other user who logs in.

This happens in practice today. The Vox Pupuli puppet-quadlets module places rootless units in /etc/containers/systemd/users/<username>/ , so every deployment using it leaks units to all users.

Suggest potential solution

Following the maintainer's suggestion in #26250, add a new directory, /etc/containers/systemd/user/<username>/, and likewise /usr/share/containers/systemd/user/<username>/. The user generator would include it only when <username> matches the user it runs as, and would search it recursively like the other user unit directories.

Because this is a new namespace, existing behaviour is unaffected. users/ keeps its "all users" meaning, named subdirectories under it still work for organising units, and users/<UID>/ stays as it is. A directory for a user that doesn't exist yet simply never matches, so there is no ambiguity.

Have you considered any alternatives?

  • Resolving the UID at deploy time. This is awkward for Puppet, where the UID isn't known at catalog compile time if the user is created in the same run. It's the same for image builds, which is the "dance" described in #26250.
  • Reinterpreting users/<username>/ as per-user. This would break people who use named subdirectories under users/ for organisation (#24783), so a separate user/ directory seems safer.

Additional context

Related: #26250, where username support and the user/<username> idea were first discussed. Also related: #28232, which added /usr/share/containers/systemd/users.

Source: podman-container-tools/podman