Check signal is unset before using user stopsignal

This fixes an issue where if a stop signal is set, and a user sends
SIGKILL, `container.ExitOnNext()` is not set, thus causing the container
to restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 114652ab86609e5c0cbfad84f642942b466a0596)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
This commit is contained in:
Brian Goff
2017-06-09 13:21:29 -07:00
committed by Eli Uriegas
parent 402dd4a9ea
commit 3910d5b571
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, sig int)
return errNotRunning{container.ID}
}
if container.Config.StopSignal != "" {
if container.Config.StopSignal != "" && syscall.Signal(sig) != syscall.SIGKILL {
containerStopSignal, err := signal.ParseSignal(container.Config.StopSignal)
if err != nil {
return err