Skip to content

Commit

Permalink
fix: report internally service as unhealthy if not running
Browse files Browse the repository at this point in the history
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 <andrey.smirnov@siderolabs.com>
(cherry picked from commit 07b9179)
  • Loading branch information
smira committed Sep 25, 2024
1 parent da5b526 commit 28b81b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/app/machined/pkg/system/service_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...interface{}) {
svcrunner.UpdateState(ctx, s, msg, args...)

if s != events.StateRunning {
svcrunner.healthState.Update(false, "service not running")
}
})
}()

Expand Down

0 comments on commit 28b81b2

Please sign in to comment.