mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use lxc-stop -k when lxc-kill is not found
lxc-kill was removed in lxc/lxc@33ddfc2 Docker-DCO-1.1-Signed-off-by: Chia-liang Kao <clkao@clkao.org> (github: clkao)
This commit is contained in:
parent
41c10fb256
commit
b111fc3646
1 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue