Skip to content

podman wait condition and communication with systemd service unit #26691

@l4rsV

Description

@l4rsV

Feature request description

The interaction of a systemd unit with podman wait is particularly unsatisfactory when using podman-compose if you want to start, control and monitor more than one container per service.

following option in the systemd unit:

[Service]
Type=simple
ExecStart=podman wait --condition=unhealthy container1 container2

This function causes the systemd unit to fail only when both containers are unhealthy. This means that they are logically linked with "and" instead of "or" as expected.

$podman wait --help
Description: Block until one or more containers stop and then print their exit codes.

It is therefore currently not possible to check the status of several containers per service unit without a workaround:

while true; do podman ps -a --format {{.Status}} --filter label=io.podman.compose.project= | grep unhealthy && exit 1; done && exit 1

I think this could be a great feature to improve the communication between service and container and to implement some kind of check/watchdog.

Regards,
Lars

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.triagedIssue has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions