From 58bb6607584e193b72f4b05ea6531e8e10d6857d Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez <pablo@resin.io> Date: Fri, 9 Mar 2018 09:19:54 -0800 Subject: [PATCH] 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> --- gosuper/gosuper/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gosuper/gosuper/api.go b/gosuper/gosuper/api.go index 7a5e8113..03f17b3d 100644 --- a/gosuper/gosuper/api.go +++ b/gosuper/gosuper/api.go @@ -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 } }