浏览代码

Merge pull request #4753 from vieux/clean_container_stop

cleanup container.stop
Michael Crosby 11 年之前
父节点
当前提交
0bb1e3d9a7
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      runtime/container.go

+ 2 - 5
runtime/container.go

@@ -886,11 +886,8 @@ func (container *Container) Kill() error {
 
 	// 2. Wait for the process to die, in last resort, try to kill the process directly
 	if err := container.WaitTimeout(10 * time.Second); err != nil {
-		if container.command == nil {
-			return fmt.Errorf("lxc-kill failed, impossible to kill the container %s", utils.TruncateID(container.ID))
-		}
-		log.Printf("Container %s failed to exit within 10 seconds of lxc-kill %s - trying direct SIGKILL", "SIGKILL", utils.TruncateID(container.ID))
-		if err := container.runtime.Kill(container, 9); err != nil {
+		log.Printf("Container %s failed to exit within 10 seconds of kill - trying direct SIGKILL", utils.TruncateID(container.ID))
+		if err := syscall.Kill(container.State.Pid, 9); err != nil {
 			return err
 		}
 	}