From 95c69588060239357bb0c1f43732d560b388429e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 29 Nov 2024 18:45:12 +0400 Subject: [PATCH] fix: don't reset health status if service doesn't support health checks Fixes #9839 Bug was introduced in #9273 Signed-off-by: Andrey Smirnov --- internal/app/machined/pkg/system/service_runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/app/machined/pkg/system/service_runner.go b/internal/app/machined/pkg/system/service_runner.go index a5bea11d98..deb2f785e5 100644 --- a/internal/app/machined/pkg/system/service_runner.go +++ b/internal/app/machined/pkg/system/service_runner.go @@ -283,7 +283,7 @@ func (svcrunner *ServiceRunner) run(ctx context.Context, runnr runner.Runner) er errCh <- runnr.Run(func(s events.ServiceState, msg string, args ...any) { svcrunner.UpdateState(ctx, s, msg, args...) - if s != events.StateRunning { + if _, healthSupported := svcrunner.service.(HealthcheckedService); healthSupported && s != events.StateRunning { svcrunner.healthState.Update(false, "service not running") } })