From 6ae05936e1f343a2ecc51b8f642bdc8b93325d81 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 7 Aug 2014 10:50:25 -0700 Subject: [PATCH] Move container start event into monitor Signed-off-by: Michael Crosby --- daemon/monitor.go | 6 +++--- daemon/start.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/monitor.go b/daemon/monitor.go index 3517589a37..6f172dc155 100644 --- a/daemon/monitor.go +++ b/daemon/monitor.go @@ -104,9 +104,7 @@ func (m *containerMonitor) reset(successful bool) { container.stdin, container.stdinPipe = io.Pipe() } - if container.daemon != nil && container.daemon.srv != nil { - container.LogEvent("die") - } + container.LogEvent("die") c := container.command.Cmd @@ -160,6 +158,8 @@ func (m *containerMonitor) Start() error { pipes := execdriver.NewPipes(m.container.stdin, m.container.stdout, m.container.stderr, m.container.Config.OpenStdin) + m.container.LogEvent("start") + if exitStatus, err = m.container.daemon.Run(m.container, pipes, m.callback); err != nil { utils.Errorf("Error running container: %s", err) } diff --git a/daemon/start.go b/daemon/start.go index cb6e9cb21f..30e015496f 100644 --- a/daemon/start.go +++ b/daemon/start.go @@ -36,7 +36,7 @@ func (daemon *Daemon) ContainerStart(job *engine.Job) engine.Status { if err := container.Start(); err != nil { return job.Errorf("Cannot start container %s: %s", name, err) } - container.LogEvent("start") + return engine.StatusOK }