execution/oci: use package sys for subreaper
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
6a8d5fdd37
commit
851d811eb2
2 changed files with 6 additions and 44 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/crosbymichael/go-runc"
|
||||
"github.com/docker/containerd/execution"
|
||||
"github.com/docker/containerd/sys"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -26,10 +27,13 @@ var (
|
|||
)
|
||||
|
||||
func New(root string) (*OCIRuntime, error) {
|
||||
err := SetSubreaper(1)
|
||||
err := sys.SetSubreaper(1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
go func() {
|
||||
syscall.Wait4(-1, nil, 0, nil)
|
||||
}()
|
||||
return &OCIRuntime{
|
||||
root: root,
|
||||
runc: &runc.Runc{
|
||||
|
@ -243,5 +247,6 @@ func (r *OCIRuntime) DeleteProcess(ctx context.Context, c *execution.Container,
|
|||
ioID := fmt.Sprintf("%s-%s", c.ID(), id)
|
||||
r.ios[ioID].cleanup()
|
||||
delete(r.ios, ioID)
|
||||
c.RemoveProcess(id)
|
||||
return c.StateDir().DeleteProcess(id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue