oracle / railcar

RailCar: Rust implementation of the Open Containers Initiative oci-runtime
Other
1.12k stars 101 forks source link

init #3

Closed jcgruenhage closed 7 years ago

jcgruenhage commented 7 years ago

Also, railcar always runs an init process separately from the container process.

Does that mean that we'll have two init processes, when the container comes with one?

vishvananda commented 7 years ago

If the container has its own init process, it will run as pid 2. In general this does not cause problems for the container init. Rkt has always behaved this way, for example.

jcgruenhage commented 7 years ago

okay.. what exactly does this pid1 process do then?

vishvananda commented 7 years ago

I should have been more clear. If the container has its own init process, the containers init process will run as pid 2 which will be a child of the railcar init. Init processes are generally ok running as pid 2 as long as pid 1 actually does the right things like reaping. The details of how the pid 2 init process will deal with things depend on how it is implemented, but in general it will just fork one or more child processes and sit there. This might clarify things: https://hackernoon.com/the-curious-case-of-pid-namespaces-1ce86b6bc900

vishvananda commented 7 years ago

Closing this for now since there is no actual issue. Feel free to reopen if you have more questions.

jcgruenhage commented 7 years ago

Yeah, sure. Thanks for answering :)