From 325f559e339444abefb74bbaea14d17531004c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 31 Mar 2016 17:01:04 -0400 Subject: [PATCH 1/2] Failure to unload the apparmor profile isn't fatal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If it was unloaded already somehow, then that's fine, if it can't be unloaded, then keep it loaded and we'll just replace it on next startup. Closes #1834 Signed-off-by: Stéphane Graber --- lxd/container_lxc.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go index 8918160287f8..a8e60370b559 100644 --- a/lxd/container_lxc.go +++ b/lxd/container_lxc.go @@ -1425,11 +1425,8 @@ func (c *containerLXC) OnStop(target string) error { return err } - // Unlock the apparmor profile - err = AAUnloadProfile(c) - if err != nil { - return err - } + // Unload the apparmor profile + AAUnloadProfile(c) // FIXME: The go routine can go away once we can rely on LXC_TARGET go func(c *containerLXC, target string, wg *sync.WaitGroup) { From 3cb413d8df0ac8f2b6afa0aa880165b8ed7fcf00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 31 Mar 2016 17:02:01 -0400 Subject: [PATCH 2/2] Prevent deadlock on container stop failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1834 Signed-off-by: Stéphane Graber --- lxd/container_lxc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go index a8e60370b559..9ad3a9c39984 100644 --- a/lxd/container_lxc.go +++ b/lxd/container_lxc.go @@ -1422,6 +1422,7 @@ func (c *containerLXC) OnStop(target string) error { // Stop the storage for this container err := c.StorageStop() if err != nil { + wg.Done() return err }