Merge pull request #2359 from cyphar/terminal-docs-subreaper

docs: terminals: mention subreaper requirement
This commit is contained in:
Akihiro Suda 2020-04-29 10:53:01 +09:00 committed by GitHub
commit c18485ada6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -228,6 +228,19 @@ Unfortunately using detached mode is a bit more complicated and requires more
care than the foreground mode -- mainly because it is now up to the caller to care than the foreground mode -- mainly because it is now up to the caller to
handle the `stdio` of the container. handle the `stdio` of the container.
Another complication is that the parent process is responsible for acting as
the subreaper for the container. In short, you need to call
`prctl(PR_SET_CHILD_SUBREAPER, 1, ...)` in the parent process and correctly
handle the implications of being a subreaper. Failing to do so may result in
zombie processes being accumulated on your host.
These tasks are usually performed by a dedicated (and minimal) monitor process
per-container. For the sake of comparison, other runtimes such as LXC do not
have an equivalent detached mode and instead integrate this monitor process
into the container runtime itself -- this has several tradeoffs, and runc has
opted to support delegating the monitoring responsibility to the parent process
through this detached mode.
#### Detached Pass-Through #### #### Detached Pass-Through ####
In detached mode, pass-through actually does what it says on the tin -- the In detached mode, pass-through actually does what it says on the tin -- the