containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.37k stars 2.31k forks source link

quadlet: add Container-spec StopSignal mapping to podman --stop-signal #23050

Open tsutsu opened 1 week ago

tsutsu commented 1 week ago

Feature request description

Using a quadlet .container unit, I want to set the stop signal for the created container.

(I have a third-party container image for a workload that ignores SIGTERM, instead only responding to SIGINT. The container image was additionally not configured with a STOPSIGNAL when built. So I need to somehow get the container unit to pass --stop-signal to podman run.)

Suggest potential solution

Just as systemd service units have StopSignal in the [Service] section, I would expect quadlet container units to support StopSignal in the [Container] section, translating it to podman --stop-signal.

Have you considered any alternatives?

I am currently using PodmanArgs=--stop-signal=SIGINT to pass the flag directly. (But it took me sleeping on the problem to even realize I could do that.)

ygalblum commented 1 week ago

Hi @tsutsu thanks for opening this issue. As you discovered, the PodmanArgs key was added for these exact cases, i.e. when the specific key is not supported. Care to open a PR to add the support for the StopSignal key?