diff --git a/containerd-shim/main.go b/containerd-shim/main.go index a7dcbe3..ece4cf7 100644 --- a/containerd-shim/main.go +++ b/containerd-shim/main.go @@ -8,7 +8,7 @@ import ( "syscall" "github.com/Sirupsen/logrus" - "github.com/docker/containerd/util" + "github.com/docker/containerd/osutils" "github.com/docker/docker/pkg/term" ) @@ -32,7 +32,7 @@ func main() { signals := make(chan os.Signal, 2048) signal.Notify(signals) // set the shim as the subreaper for all orphaned processes created by the container - if err := util.SetSubreaper(1); err != nil { + if err := osutils.SetSubreaper(1); err != nil { logrus.WithField("error", err).Fatal("shim: set as subreaper") } // open the exit pipe @@ -82,7 +82,7 @@ func main() { logrus.WithField("signal", s).Debug("shim: received signal") switch s { case syscall.SIGCHLD: - exits, err := util.Reap() + exits, err := osutils.Reap() if err != nil { logrus.WithField("error", err).Error("shim: reaping child processes") } diff --git a/containerd/main.go b/containerd/main.go index a5a5558..7ffdf3b 100644 --- a/containerd/main.go +++ b/containerd/main.go @@ -19,8 +19,8 @@ import ( "github.com/docker/containerd" "github.com/docker/containerd/api/grpc/server" "github.com/docker/containerd/api/grpc/types" + "github.com/docker/containerd/osutils" "github.com/docker/containerd/supervisor" - "github.com/docker/containerd/util" "github.com/rcrowley/go-metrics" ) @@ -141,7 +141,7 @@ func processMetrics() { // update number of goroutines g.Update(int64(runtime.NumGoroutine())) // collect the number of open fds - fds, err := util.GetOpenFds(os.Getpid()) + fds, err := osutils.GetOpenFds(os.Getpid()) if err != nil { logrus.WithField("error", err).Error("containerd: get open fd count") } @@ -194,11 +194,11 @@ func daemon(address, stateDir string, concurrency int, oom bool) error { func reapProcesses() { s := make(chan os.Signal, 2048) signal.Notify(s, syscall.SIGCHLD) - if err := util.SetSubreaper(1); err != nil { + if err := osutils.SetSubreaper(1); err != nil { logrus.WithField("error", err).Error("containerd: set subpreaper") } for range s { - if _, err := util.Reap(); err != nil { + if _, err := osutils.Reap(); err != nil { logrus.WithField("error", err).Error("containerd: reap child processes") } } diff --git a/util/fds.go b/osutils/fds.go similarity index 95% rename from util/fds.go rename to osutils/fds.go index 57d490d..98fc930 100644 --- a/util/fds.go +++ b/osutils/fds.go @@ -1,6 +1,6 @@ // +build !windows,!darwin -package util +package osutils import ( "io/ioutil" diff --git a/util/prctl.go b/osutils/prctl.go similarity index 98% rename from util/prctl.go rename to osutils/prctl.go index 1c782e8..eeb3da1 100644 --- a/util/prctl.go +++ b/osutils/prctl.go @@ -1,7 +1,7 @@ // +build linux // http://man7.org/linux/man-pages/man2/prctl.2.html -package util +package osutils import ( "syscall" diff --git a/util/reaper.go b/osutils/reaper.go similarity index 97% rename from util/reaper.go rename to osutils/reaper.go index 34b4c2f..973e417 100644 --- a/util/reaper.go +++ b/osutils/reaper.go @@ -1,4 +1,4 @@ -package util +package osutils import ( "syscall"