From 6716a3a167fcd0a9abc013ce536117175922af96 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Wed, 27 Jan 2016 03:06:45 -0500 Subject: [PATCH] Correct the info message when stop container Signed-off-by: Lei Jitang --- daemon/stop.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon/stop.go b/daemon/stop.go index e59e36cd6a..60f51410dd 100644 --- a/daemon/stop.go +++ b/daemon/stop.go @@ -38,9 +38,10 @@ func (daemon *Daemon) containerStop(container *container.Container, seconds int) return nil } - // 1. Send a SIGTERM - if err := daemon.killPossiblyDeadProcess(container, container.StopSignal()); err != nil { - logrus.Infof("Failed to send SIGTERM to the process, force killing") + stopSignal := container.StopSignal() + // 1. Send a stop signal + if err := daemon.killPossiblyDeadProcess(container, stopSignal); err != nil { + logrus.Infof("Failed to send signal %d to the process, force killing", stopSignal) if err := daemon.killPossiblyDeadProcess(container, 9); err != nil { return err } @@ -48,7 +49,7 @@ func (daemon *Daemon) containerStop(container *container.Container, seconds int) // 2. Wait for the process to exit on its own if _, err := container.WaitStop(time.Duration(seconds) * time.Second); err != nil { - logrus.Infof("Container %v failed to exit within %d seconds of SIGTERM - using the force", container.ID, seconds) + logrus.Infof("Container %v failed to exit within %d seconds of signal %d - using the force", container.ID, seconds, stopSignal) // 3. If it doesn't, then send SIGKILL if err := daemon.Kill(container); err != nil { container.WaitStop(-1 * time.Second)