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 siderolabs#9271

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Sep 4, 2024
1 parent bc8bf9e commit 07b9179
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 ...any) {
svcrunner.UpdateState(ctx, s, msg, args...)

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

Expand Down

0 comments on commit 07b9179

Please sign in to comment.