Files
Valentin Rothberg a2e80c53d4 [v4.4.1-rhel] 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.

Backport of commit 95634154303f5b8c3d5c92820e2a3545c54f0bc8.

Fixes: #17777
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180125
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2180126
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-21 09:18:42 +01:00
..
2022-01-18 12:47:07 +01:00
2022-12-15 13:39:56 +01:00
2022-10-17 09:19:41 +02:00
2022-01-18 12:47:07 +01:00
2023-01-27 09:14:12 +00:00
2022-09-20 15:34:27 -04: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-01-27 19:48:26 +00: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-12-15 13:39:56 +01:00
2022-01-18 12:47:07 +01:00
2022-07-21 14:50:01 -04:00
2022-09-10 07:52:00 -04:00
2022-01-18 12:47:07 +01:00