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 <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov 2024-09-04 22:43:31 +04:00
parent bc8bf9e8a8
commit 07b91797ca
No known key found for this signature in database
GPG Key ID: FE042E3D4085A811

View File

@ -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")
}
})
}()