summaryrefslogtreecommitdiff
path: root/libpod/healthcheck_linux.go
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-09-12 15:22:21 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-09-13 10:56:44 +0200
commitc8c2aab50d73ab767b8eb720b4d1abbc9bb36b62 (patch)
tree1b80152569dd43811ec19d40fbba4c22750a084d /libpod/healthcheck_linux.go
parent1635fe8620fa454647cf7db2af9ed0c9b52eacfb (diff)
downloadpodman-c8c2aab50d73ab767b8eb720b4d1abbc9bb36b62.tar.gz
podman-c8c2aab50d73ab767b8eb720b4d1abbc9bb36b62.tar.bz2
podman-c8c2aab50d73ab767b8eb720b4d1abbc9bb36b62.zip
health checks: restart timers
Restart the health-check timers instead of starting them. This will surpress annoying errors stating that an already running timer cannot be started anymore. Also make sure that the transient units/timers are stopped and removed when stopping a container. Fixes: #15691 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'libpod/healthcheck_linux.go')
-rw-r--r--libpod/healthcheck_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/healthcheck_linux.go b/libpod/healthcheck_linux.go
index 3fb6dfb91..6948f976a 100644
--- a/libpod/healthcheck_linux.go
+++ b/libpod/healthcheck_linux.go
@@ -70,7 +70,7 @@ func (c *Container) startTimer() error {
startFile := fmt.Sprintf("%s.service", c.ID())
startChan := make(chan string)
- if _, err := conn.StartUnitContext(context.Background(), startFile, "fail", startChan); err != nil {
+ if _, err := conn.RestartUnitContext(context.Background(), startFile, "fail", startChan); err != nil {
return err
}
if err := systemdOpSuccessful(startChan); err != nil {