From 6c2bafc2abd5aebe6080079bc1a088f63d4491ee Mon Sep 17 00:00:00 2001 From: Kreato Date: Sun, 5 Jan 2025 23:39:26 +0300 Subject: [PATCH] zimbraHealth: fix CheckZimbraServices() --- zimbraHealth/main.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/zimbraHealth/main.go b/zimbraHealth/main.go index 38af9a4..11ad417 100644 --- a/zimbraHealth/main.go +++ b/zimbraHealth/main.go @@ -249,12 +249,7 @@ func RestartZimbraService(service string) { func CheckZimbraServices() { var zimbraServices []string - status, err := ExecZimbraCommand("zmcontrol status") - - if err != nil { - common.LogError("Error getting zimbra status: " + err.Error()) - return - } + status, _ := ExecZimbraCommand("zmcontrol status") for _, service := range strings.Split(status, "\n")[1:] { svc := strings.Join(strings.Fields(service), " ") @@ -351,7 +346,7 @@ func ExecZimbraCommand(command string) (string, error) { cmd.Run() if cmd.ProcessState.ExitCode() != 0 { - return "", fmt.Errorf("Command failed: " + command) + return out.String(), fmt.Errorf("Command failed: " + command + " with stdout: " + out.String()) } return out.String(), nil