[exec] Replace syscall with /x/sys/unix

This replaces the syscall usage with sys/unix in the execution code

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-04-10 11:56:33 -07:00
parent 4f33aa2b5c
commit 4f7d521510
6 changed files with 43 additions and 37 deletions

View File

@@ -9,7 +9,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"syscall"
"time"
"github.com/containerd/containerd"
@@ -21,6 +20,7 @@ import (
runc "github.com/crosbymichael/go-runc"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
)
const (
@@ -249,9 +249,9 @@ func (r *Runtime) killContainer(ctx context.Context, id string) {
// TODO: get Command provided for initial container creation
// Command: r.Runtime,
LogFormat: runc.JSON,
PdeathSignal: syscall.SIGKILL,
PdeathSignal: unix.SIGKILL,
}
if err := runtime.Kill(ctx, id, int(syscall.SIGKILL), &runc.KillOpts{
if err := runtime.Kill(ctx, id, int(unix.SIGKILL), &runc.KillOpts{
All: true,
}); err != nil {
log.G(ctx).WithError(err).Warnf("kill all processes for %s", id)
@@ -271,7 +271,7 @@ func (r *Runtime) killContainer(ctx context.Context, id string) {
log.G(ctx).WithError(err).Warnf("delete container %s", id)
}
// try to unmount the rootfs is it was not held by an external shim
syscall.Unmount(filepath.Join(r.root, id, "rootfs"), 0)
unix.Unmount(filepath.Join(r.root, id, "rootfs"), 0)
// remove container bundle
if err := r.deleteBundle(id); err != nil {
log.G(ctx).WithError(err).Warnf("delete container bundle %s", id)