From bb133e11a9757e88069b9cbc17e69fc7ea430cdd Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Tue, 8 Jul 2014 15:21:45 -0700 Subject: [PATCH] agent: stop units in goroutine during init Fix #624 --- agent/agent.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index b0eaa7d44..a1c20e776 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -108,8 +108,10 @@ func (a *Agent) Initialize() { for _, name := range units { if _, ok := loaded[name]; !ok { log.Infof("Unit(%s) should not be loaded here, unloading", name) - a.um.Stop(name) - a.um.Unload(name) + go func() { + a.um.Stop(name) + a.um.Unload(name) + }() } }