Merge pull request #4684 from cpuguy83/4682-do_not_sigkill_on_docker_stop

Disable automatic killing of containers when docker stop fails
This commit is contained in:
Guillaume J. Charmes
2014-03-18 11:28:42 -07:00
4 changed files with 10 additions and 18 deletions
+2 -10
View File
@@ -906,20 +906,12 @@ func (container *Container) Stop(seconds int) error {
// 1. Send a SIGTERM
if err := container.KillSig(15); err != nil {
utils.Debugf("Error sending kill SIGTERM: %s", err)
log.Print("Failed to send SIGTERM to the process, force killing")
if err := container.KillSig(9); err != nil {
return err
}
return err
}
// 2. Wait for the process to exit on its own
if err := container.WaitTimeout(time.Duration(seconds) * time.Second); err != nil {
log.Printf("Container %v failed to exit within %d seconds of SIGTERM - using the force", container.ID, seconds)
// 3. If it doesn't, then send SIGKILL
if err := container.Kill(); err != nil {
return err
}
return err
}
return nil
}