diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-12 19:34:44 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-12 19:34:44 +0000 |
commit | 6e7dd2608b70e416f516d373fab7b5432fff91fa (patch) | |
tree | 7a71336265aa2c023d56e0c726c59cd7ccef69b8 /runsc/sandbox | |
parent | 3bdb2baa20f9fdccf729f423a6f1236f9dce0128 (diff) | |
parent | f2e4b5ab932a3816e4957171b303db645fd04a94 (diff) |
Merge release-20200219.0-157-gf2e4b5a (automated)
Diffstat (limited to 'runsc/sandbox')
-rw-r--r-- | runsc/sandbox/sandbox.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index 6177d6aa7..8de75ae57 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -701,6 +701,13 @@ func (s *Sandbox) createSandboxProcess(conf *boot.Config, args *Args, startSyncF nextFD++ } + if args.Attached { + // Kill sandbox if parent process exits in attached mode. + cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL + // Tells boot that any process it creates must have pdeathsig set. + cmd.Args = append(cmd.Args, "--attached") + } + // Add container as the last argument. cmd.Args = append(cmd.Args, s.ID) @@ -709,11 +716,6 @@ func (s *Sandbox) createSandboxProcess(conf *boot.Config, args *Args, startSyncF log.Debugf("Donating FD %d: %q", i+3, f.Name()) } - if args.Attached { - // Kill sandbox if parent process exits in attached mode. - cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL - } - log.Debugf("Starting sandbox: %s %v", binPath, cmd.Args) log.Debugf("SysProcAttr: %+v", cmd.SysProcAttr) if err := specutils.StartInNS(cmd, nss); err != nil { |