containerd/cmd/containerd-shim/shim_unix.go
Kenfe-Mickael Laventure d3e7af2c0a
containerd-shim: Refuse connection from uid/gid different from the shim process
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-23 17:50:13 -07:00

34 lines
705 B
Go

// +build !linux,!windows
package main
import (
"os"
"os/signal"
"google.golang.org/grpc"
"github.com/containerd/containerd/reaper"
runc "github.com/containerd/go-runc"
)
// setupSignals creates a new signal handler for all signals and sets the shim as a
// sub-reaper so that the container processes are reparented
func setupSignals() (chan os.Signal, error) {
signals := make(chan os.Signal, 2048)
signal.Notify(signals)
// make sure runc is setup to use the monitor
// for waiting on processes
runc.Monitor = reaper.Default
return signals, nil
}
// setupRoot is a no op except on Linux
func setupRoot() error {
return nil
}
func newServer() *grpc.Server {
return grpc.NewServer()
}