summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2018-09-12 15:22:24 -0700
committerShentubot <shentubot@google.com>2018-09-12 15:23:35 -0700
commit2eff1fdd061be9cfabc36532dda8cbefeb02e534 (patch)
tree009e2a9cbca191a2d2a471b30380888cd50c0b4a /runsc/container/container.go
parent0efde2bfbde2fea78134a32f5fb34332ec0ce531 (diff)
runsc: Add exec flag that specifies where to save the sandbox-internal pid.
This is different from the existing -pid-file flag, which saves a host pid. PiperOrigin-RevId: 212713968 Change-Id: I2c486de8dd5cfd9b923fb0970165ef7c5fc597f0
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r--runsc/container/container.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go
index 9a05a1dc5..38848d02f 100644
--- a/runsc/container/container.go
+++ b/runsc/container/container.go
@@ -353,13 +353,14 @@ func Run(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSocke
return c.Wait()
}
-// Execute runs the specified command in the container.
-func (c *Container) Execute(e *control.ExecArgs) (syscall.WaitStatus, error) {
- log.Debugf("Execute in container %q, args: %+v", c.ID, e)
+// Execute runs the specified command in the container. It returns the pid of
+// the newly created process.
+func (c *Container) Execute(args *control.ExecArgs) (int32, error) {
+ log.Debugf("Execute in container %q, args: %+v", c.ID, args)
if c.Status != Created && c.Status != Running {
return 0, fmt.Errorf("cannot exec in container in state %s", c.Status)
}
- return c.Sandbox.Execute(c.ID, e)
+ return c.Sandbox.Execute(c.ID, args)
}
// Event returns events for the container.