From ab1d7fd7969cc8f7496a840e3d44fbc29cdac98c Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 7 Jul 2023 01:09:45 +0700 Subject: [PATCH] cmd/ctrld: lower status string before checking Depending on system, the output of `/etc/init.d/ctrld status` can be either "Running" or "running", we must do in-sensitive comparison to get the right status of ctrld. --- cmd/ctrld/service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ctrld/service.go b/cmd/ctrld/service.go index 2865e62..5f6eeb2 100644 --- a/cmd/ctrld/service.go +++ b/cmd/ctrld/service.go @@ -131,7 +131,8 @@ func unixSystemVServiceStatus() (service.Status, error) { if err != nil { return service.StatusUnknown, nil } - switch string(bytes.TrimSpace(out)) { + + switch string(bytes.ToLower(bytes.TrimSpace(out))) { case "running": return service.StatusRunning, nil default: