From 9812e6f6058c32ff9447aae834094cc959e34d5b Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Thu, 29 May 2025 17:49:07 +0300 Subject: [PATCH] return if Service Start/Shutdown errors Previously, a couple cases could just close the shutdown channel but in logs it would appear as if they have been started. --- servmanager/servmanager.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/servmanager/servmanager.go b/servmanager/servmanager.go index 157dc07f4..3b26ce16d 100644 --- a/servmanager/servmanager.go +++ b/servmanager/servmanager.go @@ -64,6 +64,7 @@ func (m *ServiceManager) StartServices(shutdown *utils.SyncedChan) { if err := svc.Start(shutdown, m.registry); err != nil { utils.Logger.Err(fmt.Sprintf("<%s> failed to start <%s> service: %v", utils.ServiceManager, svc.ServiceName(), err)) shutdown.CloseOnce() + return } MustSetState(svc, utils.StateServiceUP) utils.Logger.Info(fmt.Sprintf("<%s> started <%s> service", utils.ServiceManager, svc.ServiceName())) @@ -116,6 +117,7 @@ func (m *ServiceManager) reloadService(id string, shutdown *utils.SyncedChan) (e if err = svc.Shutdown(m.registry); err != nil { utils.Logger.Err(fmt.Sprintf("<%s> failed to shut down <%s> service: %v", utils.ServiceManager, svc.ServiceName(), err)) shutdown.CloseOnce() + return } MustSetState(svc, utils.StateServiceDOWN) utils.Logger.Info(fmt.Sprintf("<%s> stopped <%s> service", utils.ServiceManager, svc.ServiceName()))