From 07b91797caf81162b0e491f749bf00003d3d33a4 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 4 Sep 2024 22:43:31 +0400 Subject: [PATCH] fix: report internally service as unhealthy if not running Otherwise the internal code might assume that the service is still running and healthy, never issuing a health change event. Fixes #9271 Signed-off-by: Andrey Smirnov --- internal/app/machined/pkg/system/service_runner.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/app/machined/pkg/system/service_runner.go b/internal/app/machined/pkg/system/service_runner.go index 9e7c6b9b68..a5bea11d98 100644 --- a/internal/app/machined/pkg/system/service_runner.go +++ b/internal/app/machined/pkg/system/service_runner.go @@ -282,6 +282,10 @@ func (svcrunner *ServiceRunner) run(ctx context.Context, runnr runner.Runner) er go func() { errCh <- runnr.Run(func(s events.ServiceState, msg string, args ...any) { svcrunner.UpdateState(ctx, s, msg, args...) + + if s != events.StateRunning { + svcrunner.healthState.Update(false, "service not running") + } }) }()