Files
Valentin Rothberg 9563415430 fix --health-on-failure=restart in transient unit
As described in #17777, the `restart` on-failure action did not behave
correctly when the health check is being run by a transient systemd
unit.  It ran just fine when being executed outside such a unit, for
instance, manually or, as done in the system tests, in a scripted
fashion.

There were two issue causing the `restart` on-failure action to
misbehave:

1) The transient systemd units used the default `KillMode=cgroup` which
   will nuke all processes in the specific cgroup including the recently
   restarted container/conmon once the main `podman healthcheck run`
   process exits.

2) Podman attempted to remove the transient systemd unit and timer
   during restart.  That is perfectly fine when manually restarting the
   container but not when the restart itself is being executed inside
   such a transient unit.  Ultimately, Podman tried to shoot itself in
   the foot.

Fix both issues by moving the restart logic in the cleanup process.
Instead of restarting the container, the `healthcheck run` will just
stop the container and the cleanup process will restart the container
once it has turned unhealthy.

Fixes: #17777
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-20 13:56:00 +01:00
..
2022-01-18 12:47:07 +01:00
2017-11-01 11:24:59 -04:00
2023-02-09 21:56:27 +01:00
2022-10-17 09:19:41 +02:00
2023-02-28 13:45:36 -05:00
2022-01-18 12:47:07 +01:00
2022-09-10 07:52:00 -04:00
2022-09-10 07:52:00 -04:00
2022-09-10 07:52:00 -04:00
2023-03-02 13:43:11 +01:00
2022-04-25 13:23:20 +02:00
2022-09-01 13:02:01 -04:00
2022-10-17 09:19:41 +02:00
2022-01-18 12:47:07 +01:00
2023-02-28 13:45:36 -05:00
2022-01-18 12:47:07 +01:00