Skip to content

Commit

Permalink
Use lxc-stop -k when lxc-kill is not found
Browse files Browse the repository at this point in the history
lxc-kill was removed in lxc/lxc@33ddfc2

Docker-DCO-1.1-Signed-off-by: Chia-liang Kao <clkao@clkao.org> (github: clkao)
  • Loading branch information
clkao committed Jan 30, 2014
1 parent 41c10fb commit b111fc3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion execdriver/lxc/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,16 @@ func (d *driver) version() string {
}

func (d *driver) kill(c *execdriver.Command, sig int) error {
output, err := exec.Command("lxc-kill", "-n", c.ID, strconv.Itoa(sig)).CombinedOutput()
var (
err error
output []byte
)
_, err = exec.LookPath("lxc-kill")
if err == nil {
output, err = exec.Command("lxc-kill", "-n", c.ID, strconv.Itoa(sig)).CombinedOutput()
} else {
output, err = exec.Command("lxc-stop", "-k", "-n", c.ID, strconv.Itoa(sig)).CombinedOutput()
}
if err != nil {
return fmt.Errorf("Err: %s Output: %s", err, output)
}
Expand Down

0 comments on commit b111fc3

Please sign in to comment.