-
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
error in podman generate systemd #11438
Comments
@vrothberg PTAL, we'll probably need to catch this in |
I think we can remap the container restart policy to a systemd restart policy and remove the |
I concur 👍 |
Handle custom restart policies of containers when generating the unit files; those should be set on the unit level and removed from ExecStart flags. Fixes: containers#11438 Signed-off-by: Valentin Rothberg <[email protected]>
Just stumbled into this and wonder why the error even happens? Should not it be valid to use In #7906 this was once raised and apparently allowed/fixed in #8263? Nevertheless, I agree that mapping the podman restart-policy to a systemd restart policy is a good thing to do. And AFAIK it also used to work before 3.3.0 with both arguments combined or so, but I'm not sure.
Also you need to make sure your fix does not break the healthcheck feature – that podman still restarts on a failed healthcheck. |
|
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
bug
Description
Error in the value of ExecStart of
podman generate systemd
.podman run args --rm and --restart=always mutually exclusive. It prevents starting container as a service as it gives the below error:
podman[…]: Error: the --rm option conflicts with --restart, when the restartPolicy is not "" and "no"
Steps to reproduce the issue:
podman run -d
--restart=always
--tz=Europe/Budapest
-p 27017:27017
-v mongoconfig:/data/configdb
-v mongodata:/data/db
-v mongodump:/dump
--name=mongo
docker.io/library/mongo:4 --auth
podman generate systemd --files --new --name mongo
podman rm -f mongo
systemctl enable --now container-mongo.service
Describe the results you received:
podman[6745]: Error: the --rm option conflicts with --restart, when the restartPolicy is not "" and "no"
Describe the results you expected:
enable and start container as a service
Additional information you deem important (e.g. issue happens only occasionally):
I have removed the arg
--rm
from the ExecStart in the service file and I could start the service successfully.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
physical
The text was updated successfully, but these errors were encountered: