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 --restart-sec is not honored by containers #16419

Closed
nivekuil opened this issue Nov 5, 2022 · 9 comments · Fixed by #16475
Closed

podman generate systemd --restart-sec is not honored by containers #16419

nivekuil opened this issue Nov 5, 2022 · 9 comments · Fixed by #16475
Assignees
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

@nivekuil
Copy link

nivekuil commented Nov 5, 2022

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

/kind bug

Description

podman generate systemd --restart-sec pod only generates RestartSec= in the pod service, not the container service. This basically renders it ineffective since the containers are the ones likely to be restarting.

Steps to reproduce the issue:

  1. podman generate systemd --restart-sec 3 my-pod and inspect the service file of its container

Describe the results you received:

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=always
TimeoutStopSec=90
ExecStart=/usr/bin/podman start my-ctr
ExecStop=/usr/bin/podman stop -t 30 my-ctr
ExecStopPost=/usr/bin/podman stop -t 30 my-ctr
PIDFile=/run/containers/storage/overlay-containers/4b6f4efab716b240ea1f6e65d4f672cb83ec426713fc651f34970eafc0a91e4c/userdata/conmon.pid
Type=forking

Describe the results you expected:
Should have RestartSec= in there

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

Output of podman version:

Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.19
Built:        Wed Sep  7 19:57:53 2022
OS/Arch:      linux/amd64

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 Nov 5, 2022
@vrothberg vrothberg added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Nov 7, 2022
@vrothberg
Copy link
Member

Thanks for reaching out, @nivekuil !

@Darth-Mera
Copy link
Contributor

Hi, I'd like to try to take on this one as a first issue, if that's ok :)

@rhatdan
Copy link
Member

rhatdan commented Nov 9, 2022

Fine with me.

@aadi58002
Copy link

Can i also try to work on this issue?

@vrothberg
Copy link
Member

vrothberg commented Nov 10, 2022

@Darth-Mera asked first, so I'd very much prefer to keep this order. Please respect that @aadi58002 before opening a PR next time. It's not a race.

Darth-Mera added a commit to Darth-Mera/podman that referenced this issue Nov 10, 2022
Attempts to fix containers#16419

podman generate systemd --restart-sec pod
^now generates RestartSec= both in pod service file and in container service file.

podman generate systemd --restart-sec container
^now generates RestartSec= in container service file.

Signed-off-by: Veronika Fuxova <vfuxova@redhat.com>
@Darth-Mera
Copy link
Contributor

I pushed my attempt at solving this issue. Not a fan of duplicating work, but I guess we're both learning.

@aadi58002
Copy link

I pushed my attempt at solving this issue. Not a fan of duplicating work, but I guess we're both learning.

It was a leaning experience for me as well. I also looked at your PR which is much better and more better done than mine thanks for providing a good experience and learning.

@rhatdan
Copy link
Member

rhatdan commented Nov 10, 2022

Thanks to both of you. Nice thing is there are plenty more "good first issues" to work on.
Again thanks for contributing.

@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 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 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.

5 participants