podman: Wrong status after service failed to start but some containers did
I have podman configured to run as a service at boot time. There are about 6 containers configured to always restart, so the service should pick them all up and start accordingly.
However, for a known reason, some containers fail to start, which results in podman service itself failing to start, which is expected:
Feb 26 12:21:19 myvm daemon.err /etc/init.d/podman[2631]: ERROR: podman failed to start
The service status, however, is 'stopped', not 'crashed' like it should be:
myvm:~# rc-service podman status
* status: stopped
The rest of the containers which have not failed are running fine at this point, which makes it impossible to start the service again:
myvm:~# rc-service podman start
* Caching service dependencies ... [ ok ]
* Configured as rootful service
* Starting Podman API service ...
* supervise-daemon: /usr/bin/podman is already running
* failed to start Podman API service [ !! ]
* ERROR: podman failed to start
The fact that the service is in 'stopped' status already, makes it also impossible to properly shut down the 'zombie' containers (I mean outside of manually iterating them with podman stop
, but who wants that). At the very least it should be crashed
status, which would allow to actually issue an rc-service podman stop
and a subsequent start
.
It may also be worth considering implementing OpenRC health checks, as explained in https://github.com/OpenRC/openrc/blob/master/supervise-daemon-guide.md