Commit Graph

6 Commits

Author SHA1 Message Date
Michael Crosby fdb100d247 Destroy container along with processes before stdio
We need to make sure the container is destroyed before closing the stdio
for the container.  This becomes a big issues when running in the host's
pid namespace because the other processes could have inherited the stdio
of the initial process.  The call to close will just block as they still
have the io open.

Calling destroy before closing io, especially in the host pid namespace
will cause all additional processes to be killed in the container's
cgroup.  This will allow the io to be closed successfuly.

This change makes sure the order for destroy and close is correct as
well as ensuring that if any errors encoutered during start or exec will
be handled by terminating the process and destroying the container.  We
cannot use defers here because we need to enforce the correct ordering
on destroy.

This also sets the subreaper setting for runc so that when running in
pid host, runc can wait on the addiontal processes launched by the
container, useful on destroy, but also good for reaping the additional
processes that were launched.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-15 13:17:11 -07:00
Michael Crosby 546af43fbc Check if tty is nil in handler
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-17 13:20:22 -08:00
Mrunal Patel 9d281a503e signal: Fix leak
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-27 13:05:15 -04:00
Jin-Hwan Jeong 094a83b25e in signals.go: depeding -> depending
in tty.go: pty -> tty

Signed-off-by: Jin-Hwan Jeong <jhjeong.kr@gmail.com>
2015-07-15 10:11:24 +09:00
Marianna 5aa82c950d Enable build on unsupported platforms
Should compile now without errors but changes needed to be added for each system so it actually works.
main_unsupported.go is a new file with all the unsupported commands
Fixes #9

Signed-off-by: Marianna <mtesselh@gmail.com>
2015-06-29 17:03:44 -07:00
Michael Crosby 9fac183294 Initial commit of runc binary
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:34:13 -07:00