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

quadlet should be able to configure the container stop timeout #21134

Closed
acrispino opened this issue Jan 3, 2024 · 8 comments · Fixed by #21142
Closed

quadlet should be able to configure the container stop timeout #21134

acrispino opened this issue Jan 3, 2024 · 8 comments · Fixed by #21142
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@acrispino
Copy link

Feature request description

I'm using mysql with quadlet and when shutting down the service, there's a warning: StopSignal SIGTERM failed to stop container systemd-mysql in 10 seconds, resorting to SIGKILL. In my case, I think I need about 20 seconds for a clean shutdown, but there does not seem to be a way to change the setting.

Suggest potential solution

It should be possible for a container unit to configure the stop timeout

Have you considered any alternatives?

At first TimeoutStopSec= seemed like a possible solution but it does not appear to have any effect.

I suppose it's possible to run quadlet directly, edit the generated service, and use that file instead. But I'd rather not

Additional context

Add any other context or screenshots about the feature request here.

@acrispino acrispino added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 3, 2024
@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2024

Does
PodmanArgs=--stop-signal=SIGKILL
Fix it?

I would think TimeoutStopSec should do it as well.

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2024

@vrothberg @ygalblum WDYT?

@vrothberg
Copy link
Member

PodmanArgs is a good workaround. TimeoutStopSec is a systemd-specific field and not under the [Container] table.

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2024

Right move it up to the [Service] definition of the quadlet.

@ygalblum
Copy link
Collaborator

ygalblum commented Jan 3, 2024

This message comes from Podman and not from systemd. Meaning, it is the podman rm command that times out and resorts to SIGKILL. So, setting TimeoutStopSec will not help.

What needs to be set is the time argument for the podman rm command. Currently, Quadlet does not support any keys to manage the ExecStop command (specific or generic).

@acrispino
Copy link
Author

Does PodmanArgs=--stop-signal=SIGKILL Fix it?

I added PodmanArgs=--stop-timeout 60 and that's working for me. Thank you for the hint!

@jensk-dev
Copy link

It is interesting that StopTimeout is documented in the podman unit file documentation. However, when adding it to the [Container] group of a .container file as described it results in the following error during a dryrun

my-process@localhost:~$ /usr/lib/systemd/system-generators/podman-system-generator --user --dryrun
quadlet-generator[16700]: Loading source unit file /home/my-process/.config/containers/systemd/my-process.container
quadlet-generator[16700]: converting "my-process.container": unsupported key 'StopTimeout' in group 'Container' in /home/my-process/.config/containers/systemd/my-process.container

Is StopTimeout coming in a future podman release, or has it been deprecated, or why is it still documented?

@ygalblum
Copy link
Collaborator

@jensk-dev this is known issue with the documentation site. The link you added points to the latest version which corresponds to the main branch. So, make sure to adjust the documentation to the Podman version you are using. E.g. v4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants