From 3de40ddf988a127e497456547acc5b63e013d5db Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 21 Apr 2019 12:27:53 -0700 Subject: [PATCH] Fix handling of kill in daemon --- server/environment_docker.go | 2 +- websocket.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/environment_docker.go b/server/environment_docker.go index 2e20233..dfd3f52 100644 --- a/server/environment_docker.go +++ b/server/environment_docker.go @@ -163,7 +163,7 @@ func (d *DockerEnvironment) Terminate(signal os.Signal) error { } d.Server.Emit(StatusEvent, ProcessStoppingState) - return d.Client.ContainerKill(ctx, d.Server.Uuid, signal.String()) + return d.Client.ContainerKill(ctx, d.Server.Uuid, "SIGKILL") } // Attaches to the docker container itself and ensures that we can pipe data in and out diff --git a/websocket.go b/websocket.go index 4f04093..039b3e7 100644 --- a/websocket.go +++ b/websocket.go @@ -131,6 +131,8 @@ func (wsh *WebsocketHandler) HandleInbound(m WebsocketMessage) error { err = wsh.Server.Environment.Stop() break case "restart": + break + case "kill": err = wsh.Server.Environment.Terminate(os.Kill) break }