From 3d0cd8442ee33a6da8c179d88551e0be887a2d5a Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Fri, 15 Jul 2016 04:59:52 -0400 Subject: [PATCH] Fix daemon panic use wrong graphdriver with --live-restore flag Signed-off-by: Lei Jitang (cherry picked from commit d9e8cea1b666cc22d6747482ad16600cb9dc6fa1) Signed-off-by: Tibor Vass --- daemon/daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 978cf82fc8..7c345c30dc 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -653,7 +653,7 @@ func (daemon *Daemon) Shutdown() error { daemon.shutdown = true // Keep mounts and networking running on daemon shutdown if // we are to keep containers running and restore them. - if daemon.configStore.LiveRestore { + if daemon.configStore.LiveRestore && daemon.containers != nil { // check if there are any running containers, if none we should do some cleanup if ls, err := daemon.Containers(&types.ContainerListOptions{}); len(ls) != 0 || err != nil { return nil