summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 2ddb358bd..5e9ccb96f 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -77,8 +77,11 @@ type Loader struct {
watchdog *watchdog.Watchdog
- // ioFDs are the FDs that attach the sandbox to the gofers.
- ioFDs []int
+ // stdioFDs contains stdin, stdout, and stderr.
+ stdioFDs []int
+
+ // goferFDs are the FDs that attach the sandbox to the gofers.
+ goferFDs []int
// spec is the base configuration for the root container.
spec *specs.Spec
@@ -121,7 +124,7 @@ func init() {
// New initializes a new kernel loader configured by spec.
// New also handles setting up a kernel for restoring a container.
-func New(spec *specs.Spec, conf *Config, controllerFD, deviceFD int, ioFDs []int, console bool) (*Loader, error) {
+func New(spec *specs.Spec, conf *Config, controllerFD, deviceFD int, goferFDs []int, console bool) (*Loader, error) {
// Create kernel and platform.
p, err := createPlatform(conf, deviceFD)
if err != nil {
@@ -252,7 +255,8 @@ func New(spec *specs.Spec, conf *Config, controllerFD, deviceFD int, ioFDs []int
conf: conf,
console: console,
watchdog: watchdog,
- ioFDs: ioFDs,
+ stdioFDs: []int{syscall.Stdin, syscall.Stdout, syscall.Stderr},
+ goferFDs: goferFDs,
spec: spec,
startSignalForwarding: startSignalForwarding,
rootProcArgs: procArgs,
@@ -364,7 +368,8 @@ func (l *Loader) run() error {
&l.rootProcArgs,
l.spec,
l.conf,
- l.ioFDs,
+ l.stdioFDs,
+ l.goferFDs,
l.console,
l.rootProcArgs.Credentials,
l.rootProcArgs.Limits,
@@ -446,7 +451,8 @@ func (l *Loader) startContainer(k *kernel.Kernel, spec *specs.Spec, conf *Config
&procArgs,
spec,
conf,
- ioFDs,
+ ioFDs[:3], // stdioFDs
+ ioFDs[3:], // goferFDs
false,
creds,
procArgs.Limits,