Skip to content
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

podman generate systemd --new mishandles the --stop-timeout argument #16149

Closed
nolange opened this issue Oct 13, 2022 · 2 comments · Fixed by #16176
Closed

podman generate systemd --new mishandles the --stop-timeout argument #16149

nolange opened this issue Oct 13, 2022 · 2 comments · Fixed by #16176
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@nolange
Copy link

nolange commented Oct 13, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Generation a systemd unit file should take the --stop-timeout argument and pass it to
podman stop.

If the --new flag is used, then this is not happening.

Steps to reproduce the issue:

podman run --rm -d --name test debian sleep 10
podman generate systemd test --new  --stop-timeout 100

Describe the results you received:

TimeoutStopSec=160
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
	--cidfile=%t/%n.ctr-id \
	--cgroups=no-conmon \
	--rm \
	--sdnotify=conmon \
	--replace \
	-d \
	--name test debian sleep 10
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id

Describe the results you expected:

TimeoutStopSec=160
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
	--cidfile=%t/%n.ctr-id \
	--cgroups=no-conmon \
	--rm \
	--sdnotify=conmon \
	--replace \
	-d \
	--name test debian sleep 10
ExecStop=/usr/bin/podman stop -t 100 --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id

(I am not sure if the Timeout should be added in ExecStopPost aswell)

Additional information you deem important (e.g. issue happens only occasionally):

The issue is only appearing if --new is used.

Output of podman version:

(paste your output here)

Output of podman info:

Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.19.1
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

podman/unknown,now 4.2.1-0.1 amd64 [installed]

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2022
@mheon
Copy link
Member

mheon commented Oct 13, 2022

@vrothberg PTAL

@Luap99 Luap99 added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Oct 13, 2022
@vrothberg
Copy link
Member

Thanks for reaching out, @nolange! I'll wrap up a PR to fix the issue.

vrothberg added a commit to vrothberg/libpod that referenced this issue Oct 14, 2022
Make sure to always the stop timeout for unit generated via `--new`.

Fixes: containers#16149
Signed-off-by: Valentin Rothberg <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Oct 18, 2022
Make sure to always the stop timeout for unit generated via `--new`.

Fixes: containers#16149
Signed-off-by: Valentin Rothberg <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants