From 2cfd978e659181165be4fc92f760556e85cc2806 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Sun, 13 Sep 2015 22:52:56 -0400 Subject: [PATCH] Fix container register failed during daemon start and try to start the container Signed-off-by: Lei Jitang Upstream-commit: b4841dd2371cdab8ef6e01d8304622fdb3578644 Component: engine --- components/engine/daemon/daemon.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/engine/daemon/daemon.go b/components/engine/daemon/daemon.go index 3dcf93b629..c693ac4664 100644 --- a/components/engine/daemon/daemon.go +++ b/components/engine/daemon/daemon.go @@ -314,7 +314,9 @@ func (daemon *Daemon) restore() error { } if err := daemon.Register(container); err != nil { - logrus.Debugf("Failed to register container %s: %s", container.ID, err) + logrus.Errorf("Failed to register container %s: %s", container.ID, err) + // The container register failed should not be started. + return } // check the restart policy on the containers and restart any container with @@ -323,7 +325,7 @@ func (daemon *Daemon) restore() error { logrus.Debugf("Starting container %s", container.ID) if err := container.Start(); err != nil { - logrus.Debugf("Failed to start container %s: %s", container.ID, err) + logrus.Errorf("Failed to start container %s: %s", container.ID, err) } } }(c.container, c.registered)