gosuper: Treat systemd unit states that are not "inactive" or "deactivating" as enabled states

This should make the supervisor detect the VPN as enabled when it's starting up (or restarting because of an error).

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2018-03-09 09:19:54 -08:00
parent 3b60065f12
commit 58bb660758

View File

@ -124,7 +124,8 @@ func getUnitStatus(unitName string) (state bool, err error) {
err = fmt.Errorf("Unable to get unit status: %v", e)
return
} else {
state = activeState.Value.String() == `"active"`
activeStateStr := activeState.Value.String()
state = activeStateStr != `"inactive"` && activeStateStr != `"deactivating"`
return
}
}