Skip to content

An official way to send signals into a container for ExecReload= #22036

@yrro

Description

@yrro

Feature request description

Where foo is a Podman Quadlet .container service, I'd like systemctl reload foo to send a SIGHUP to the container's main process.

I'm currently doing this:

[Service]
ExecReload=/usr/bin/podman kill -s SIGHUP --cidfile=%t/%N.cid

I got the --cidfile=%r/%N.cid construct by looking at the ExecStart= directive in the generated foo.service unit. But it feels a bit non/obvious & like I'm relying on an implementation detail of Quadlet. Not one that's likely to change, but it would be nice if there was a more documented/obvious way to be able to send signals into the container.

This would also work:

[Service]
ExecReload=/usr/bin/podman kill -s SIGHUP systemd-%N

... but it relies on the user not also specifying ContainerName=.

Suggest potential solution

Quadlet could introduce its own specifiers that it expands during .container file processing. Something like:

[Container]
ExecReload=/usr/bin/podman kill -s SIGHUP %N

However it would probably be too confusing for Quadlet and systemd to both be doing their own expansion processing on directives with differently defined specifiers.

Have you considered any alternatives?

Document --cidfile=%t/%N.cid in podman-systemd.unit(5) and add it to the test.container example within podman-systemd.unit(5). But this will make it an interface promise, so if you wanted to put Quadlet's cidfiles somewhere else in the future you'd break people's .container units.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.quadletstale-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions