Skip to content
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

Init process created even when clone_newpid is false #57

Closed
joelweinberger opened this issue Oct 24, 2017 · 1 comment
Closed

Init process created even when clone_newpid is false #57

joelweinberger opened this issue Oct 24, 2017 · 1 comment

Comments

@joelweinberger
Copy link

Currently, when an init process is created in pidInitNs, it does this whenever the mode is execve, even when clone_newpid is false. This is problematic since, in that case, the new process will actually now be a child of the execve'd process, and when that process dies, the "init" process is reparented to 1, and becomes a dangling process that never exits.

I believe the line at

nsjail/pid.c

Line 36 in 152d6d6

if (nsjconf->mode != MODE_STANDALONE_EXECVE) {
should be modified to read:
if (nsjconf->mode != MODE_STANDALONE_EXECVE || !nsjconf->clone_newpid) {

That way, an init process would not be created if the mode is execve but clone_newpid is false.

@robertswiecki
Copy link
Collaborator

Thanks,

Code added in 6dc0808

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants