f-29: watchdog: add checkvms #29

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-08-17 23:38:07 +02:00
commit cb812c97ab
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
3 changed files with 355 additions and 6 deletions

View file

@ -99,13 +99,17 @@ func (m *Manager) Status(service string) (*ServiceStatus, error) {
return nil, err
}
status := &ServiceStatus{
Name: service,
LoadState: props["LoadState"].(string),
ActiveState: props["ActiveState"].(string),
SubState: props["SubState"].(string),
}
status := &ServiceStatus{Name: service}
if v, ok := props["LoadState"].(string); ok {
status.LoadState = v
}
if v, ok := props["ActiveState"].(string); ok {
status.ActiveState = v
}
if v, ok := props["SubState"].(string); ok {
status.SubState = v
}
if pid, ok := props["MainPID"].(uint32); ok {
status.MainPID = pid
}