Skip to content

BuildNot yet confirmed elsewhere1 publisher2 min readPublished

Rootful Podman's restart policy stalls after one restart for ID-mapped containers on AppArmor hosts

Rootful Podman restarts a container with its own --uidmap mapping once on an AppArmor host, then leaves it exited with RestartCount stuck at 1. A dev.to reproduction on Debian found the policy still looks configured afterwards, so a service relying on it can stay down unnoticed.

The Engineer · Build desk

How we use AISend a correction

Illustration accompanying Rootful Podman's restart policy stalls after one restart for ID-mapped containers on AppArmor hosts
Generated illustration

What happened

  • The podman container cleanup process that should restart the container fails with an error saying AppArmor is disabled, on a host where it is enabled.
  • A mapped container on --restart on-failure:3 whose command exits with status 1 also stops at one restart.
  • In a 25-second test, the same container without the mapping, or with apparmor=unconfined, reached five restarts and was still running.
  • A Quadlet unit with UIDMap= and Restart=always was restarted by systemd every time.
  • The write-up reproduced it on Debian 13 with podman 5.4.2, and upstream report podman#29925 shows it on Ubuntu 26.04 with 5.7.0 and 6.1.3.

Why it matters

  • constraint A test that kills an affected container once and watches it return will pass, so proving a restart policy on these hosts takes at least two exits.
  • exposure The trigger is a hardening choice: --uidmap is how operators run rootful containers as unprivileged host IDs, so the more carefully isolated services are the ones that lose automatic recovery.
  • constraint Upstream has no diagnosis yet and every release tested shows the stall, so there is no Podman version known to fix it.

According to the dev.to write-up, conmon launches the cleanup process as `podman container cleanup --stopped-only <id>` when the container exits [12]. The AppArmor message comes from the AppArmor package in containers/common [18]. There, IsEnabled() returns whether IsSupported() succeeds [18]. In v0.62.2, the version in Debian, IsSupported() runs three checks in order: the process must not be rootless, the kernel must report AppArmor as on, and a lookup for the apparmor_parser binary must succeed [18]. The author notes that the wording points at the host configuration rather than at Podman [14]. On the test VM, /sys/module/apparmor/parameters/enabled read Y [9].

The obvious suspect is the rootless check. The write-up's strace of conmon rules it out on the evidence available. It shows the cleanup process running as root inside the host user namespace, with no Podman user-namespace variable set in its environment; the process never re-executed itself and never called unshare [19]. Effective capabilities for conmon, CapEff 000001ffffffffff in the host user namespace, matched between the mapped and the plain container [20]. If the rootless check passes, the failure sits in one of the other two: the kernel's AppArmor flag or the apparmor_parser lookup [22].

After the stall, podman inspect still shows the policy as always, and the event stream holds the one restart event [13]. Without --syslog on the command that created the container, the cleanup process has nowhere to report the error. It never reaches the journal, podman logs or the event stream [3]. Running podman start by hand brings the container back without complaint [10].

The reproduction ran as root on a Debian 13.7 VM with kernel 6.12.111, crun 1.21, conmon 2.1.12 and containers-common 0.62.2 [8]. Each of its three alpine test containers exits after four seconds and carries --restart always [8].

Most Podman hosts never hit this. Rootless Podman does not use AppArmor profiles, and Fedora and RHEL use SELinux [15]. The author did not test other ways of giving a container its own mapping, such as --userns=auto [17].

The author's toolkit includes check-podman-restart-userns.sh to list containers that are stuck or will get stuck [7]. Setting --security-opt apparmor=unconfined keeps restarts going by taking the AppArmor profile off the container [5]. We think Quadlet is the right fix for hosts that adopted --uidmap for isolation. With Quadlet, the unit keeps its UIDMap= line and systemd owns the restart [6].

What to watch

  • Whether podman#29925 pins the failure to a specific IsSupported() check and names a release that fixes it.
  • Results for --userns=auto and other mapping options; a stall there widens the affected set beyond --uidmap/--gidmap users.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence62
Adoption
Insufficient
Hype gap−5
Incentives20
Confidence58
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    On a host with AppArmor enabled, a rootful Podman container with its own ID mapping (--uidmap/--gidmap) and a restart policy is restarted once at most; when it exits the second time it stays exited, podman events shows died, restart and then nothing, and RestartCount stops at 1.

    ReportedSupportedSource: dev.to write-up by homelabpmView cited source
  2. [2]

    The process that should restart the container, podman container cleanup, fails with: profile "containers-default-0.62.2" specified but AppArmor is disabled on the host, although AppArmor is enabled.

    ReportedSupportedSource: dev.to write-upView cited source
  3. [3]

    The error is logged only if the container was created with podman --syslog; without it the cleanup process has no place to report the error, so it is not in the journal, in podman logs, or in the events.

    ReportedSupportedSource: dev.to write-upView cited source

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · October 10, 2026

    Rootful Podman restarts a --uidmap container once on an AppArmor host, then gives up

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Topics

  • Linux user namespacesFollow
  • SELinux and Mandatory Access ControlFollow
  • Container restart policiesFollow
Loading related stories