Kill container on delete
If the container's state is `created` when runc delete is called make sure that the init is killed before deleting the on system state. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
3fc929f350
commit
88dcf1d686
|
@ -5,6 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
|
@ -36,6 +37,10 @@ status of "ubuntu01" as "destroyed" the following will delete resources held for
|
|||
}
|
||||
return nil
|
||||
}
|
||||
s, err := container.Status()
|
||||
if err == nil && s == libcontainer.Created {
|
||||
container.Signal(syscall.SIGKILL)
|
||||
}
|
||||
destroy(container)
|
||||
return nil
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue