mirror of https://github.com/docker/docs.git
Merge pull request #3844 from clkao/lxc-kill-deprecation
Use lxc-stop -k instead of lxc-kill
This commit is contained in:
commit
f267938fb8
|
@ -214,7 +214,16 @@ func (d *driver) version() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) kill(c *execdriver.Command, sig int) error {
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("Err: %s Output: %s", err, output)
|
return fmt.Errorf("Err: %s Output: %s", err, output)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue