-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Units created with "podman generate systemd --new" fail due missing podman state cleanup before start #7157
Comments
Do your systemd units include In general, we strongly recommend using |
Yeah I mean this was just a wrapper script made for docker which I rushed converting to podman after all.
But still, this implies there might be cases where even the |
Yes - we try and avoid that with an explicit 'podman rm' on the container
in an ExecStartPre
…On Sat, Aug 1, 2020, 10:12 Yan Minari ***@***.***> wrote:
Do your systemd units include KillMode=none?
Nope
<https://gist.github.com/yangm97/573b86a8b82181723aea96f70e690a98#file-yggdrasil-service>
In general, we strongly recommend using podman generate systemd to make
unit files, as it handles some of the "gotchas" like this.
Yeah I mean this was just a wrapper script made for docker which I rushed
converting to podman after all.
Otherwise, systemd will aggressively kill Podman's cleanup process,
preventing the container from being unmounted or removed.
But still, this implies there might be cases where even the podman
generated unit files trigger this issue, such as sudden power loss, am I
correct?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7157 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCCB2GYQPJE2OME52WLR6QPELANCNFSM4POGBUGA>
.
|
Guess I'm going to close this as misconfiguration from my side, but feel free to reopen in case you guys need it. |
Doesn't seem like it, from podman/pkg/systemd/generate/containers.go Line 246 in dd4e0da
Using the generated systemd unit still led me to a situation where the container refuses to start because of a name conflict.
So it looks like the |
We are cleaning up the files in ExecStartPre but not the containers. However, there's an explicit clean-up for named containers where we're setting the @yangm97, did you remove the |
Nope, just ran the generate command and pasted as is. Looks like podman/pkg/systemd/generate/containers.go Line 210 in dd4e0da
|
Here we're initializing the variable which is okay. But I could now track it down. We're not catching the |
Opened #7571 |
The systemd generator looks for certain flags in the containers' create commands to determine which flags need to be added. In case of named containers, the generator adds the `--replace` flag to prevent name conflicts at container creation. Fix the generator to not only cover the `--name foo` syntax but also the `--name=foo` one. Fixes: containers#7157 Signed-off-by: Valentin Rothberg <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
There's an issue with "undead" containers created with
--rm
from withn a shell script launched by a systemd unit which clog up state, and possibly corrupt state when too many of those are present.They show up on
ps -a
asCreated
.container prune
on 1.6.x (plus armbian stretch) doesn't clean them, on 2.0.x (plus armbian buster) it almost always cleans all of those "undead" containers, except for when it fails with errors such asfollowed by
(btw isn't it weird that a prune operation is trying to mount stuff?)
Steps to reproduce the issue:
I couldn't narrow down where this is coming, it's one of those issues which happen "on its own" and "when it feels like doing so" 🙃, so the reproduction I could come up with was to mimick my exact environment using the ansible playbook and scripts from this gist:
https://gist.github.com/yangm97/573b86a8b82181723aea96f70e690a98
This play will:
Having that set up:
Describe the results you received:
Describe the results you expected:
Containers created with
--rm
should always be removed.Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Orange pi zero running armbian:
The text was updated successfully, but these errors were encountered: