Browse Source

Merge pull request #4753 from vieux/clean_container_stop

cleanup container.stop
Michael Crosby 11 years ago
parent
commit
0bb1e3d9a7
1 changed files with 2 additions and 5 deletions
  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
 	// 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 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
 			return err
 		}
 		}
 	}
 	}