-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--pid=container:<id> does not reparent zombies to pid 1 #25348
Comments
I think this is inevitable, as only pid 1 is special in terms of parent, while the process you create really does have a parent outside the namespace. You might be able to fix this in the kernel. Would it help if there was an extra |
I guess I had assumed we had found how to do the re-parenting or that PID namespaces did something sane here. If this is just how PID ns works (and I am not inclined to go trawling kernel code for this :) then we should document the behavior. Much noise has been made of "the pid 1 problem" but this totally avoids it (in this case). |
I see the bug here. Its a bug with how runc is handling joining an existing pid ns, its not doing a double fork to reparent the processes once it is inside the pid ns. So its parent will stay on the outside of the container, I'll open an issue on runc and link this. |
also, we already do this double fork for the |
@crosbymichael Excellent news. thanks! |
AFAICT exec is broken in the exact same way:
FWIW, this (exec) works correctly in Docker 1.9.1 (I just re-verified). It On Wed, Aug 3, 2016 at 9:59 AM, Michael Crosby [email protected]
|
The behavior is expected. A double fork should fix it as @crosbymichael pointed out. See diagrams here https://lwn.net/Articles/532748/ that explain the behavior. |
I don't parse that. If it is expected, it is not a bug, but you then say On Wed, Aug 3, 2016 at 11:22 AM, Mrunal Patel [email protected]
|
@thockin Sorry, I meant that I see why it is behaving the way it is because of our implementation. |
Yeah, I will include a fix for this in opencontainers/runc#950. Internally, both the shared namespace and |
cool! On Wed, Aug 3, 2016 at 12:03 PM, Mrunal Patel [email protected]
|
ping @crosbymichael is there any progress on this issue? Should this stay on the 1.12.2 milestone? |
opencontainers/runc#976 is where my fix for this issue is being worked on, but I'm currently swamped with the other |
Thanks @cyphar, I think it's reasonable to assume this won't be fixed before a 1.12.x patch release; let me move it to 1.13 (hopefully) |
After a bunch of review, it looks like this might be possible with the very-rarely-used |
Trying to use shared PID namespaces, we observe that zombie processes are not being reparented to pid 1.
From a simple
docker run
it works.This is a pretty clear success. If I do this same experiment from a container that joins another PID ns, though:
This means that any such container is not managed by the in-container init, but by the host's init. Is this intentional or a bug?
@dims
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: