Skip to content

Commit 46c361b

Browse files
committed
zimbraHealth: changed the way some zimbra services are restarted
1 parent 30e254e commit 46c361b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

zimbraHealth/main.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,33 @@ func CheckZimbraServices() []ServiceInfo {
680680

681681
// Attempt restarts for services that are down
682682
for _, svc := range currentServices {
683+
service := strings.TrimSpace(svc.Name)
684+
switch service {
685+
case "zmswatchctl", "zmswatch":
686+
output, err := ExecZimbraCommand("zmzmswatchctl stop", false, false)
687+
log.Debug().Str("output", output).Msg("zmzmswatchctl stop output")
688+
if err == nil {
689+
output, err = ExecZimbraCommand("zmzmswatchctl start", false, false)
690+
log.Debug().Str("output", output).Msg("zmzmswatchctl start output")
691+
}
692+
continue
693+
case "zmlogswatchctl", "zmlogswatch":
694+
output, err := ExecZimbraCommand("zmlogswatchctl stop", false, false)
695+
log.Debug().Str("output", output).Msg("zmlogswatchctl stop output")
696+
if err == nil {
697+
output, err = ExecZimbraCommand("zmlogswatchctl start", false, false)
698+
log.Debug().Str("output", output).Msg("zmlogswatchctl start output")
699+
}
700+
continue
701+
case "zmstatctl", "zmstat", "stats":
702+
output, err := ExecZimbraCommand("zmstatctl stop", false, false)
703+
log.Debug().Str("output", output).Msg("zmstatctl stop output")
704+
if err == nil {
705+
output, err = ExecZimbraCommand("zmstatctl start", false, false)
706+
log.Debug().Str("output", output).Msg("zmstatctl start output")
707+
}
708+
continue
709+
}
683710
if !svc.Running {
684711
log.Warn().Str("service", svc.Name).Msg("Service is not running")
685712
common.WriteToFile(common.TmpDir+"/"+"zmcontrol_status_"+time.Now().Format("2006-01-02_15.04.05")+".log", initialOutput)

0 commit comments

Comments
 (0)