fixup! Add init groups.
This commit is contained in:
parent
b9c49648c4
commit
c6c285a414
2 changed files with 13 additions and 4 deletions
|
@ -223,11 +223,20 @@ void Process::OnLastThreadExit()
|
||||||
// Forbid any more processes and threads from being created, so this
|
// Forbid any more processes and threads from being created, so this
|
||||||
// loop will always terminate.
|
// loop will always terminate.
|
||||||
is_init_exiting = true;
|
is_init_exiting = true;
|
||||||
for ( Process* process = initfirst; process;
|
Process* process = firstchild;
|
||||||
process = process->initnext )
|
while ( process )
|
||||||
{
|
{
|
||||||
if ( process->pid != 0 && process != this )
|
if ( process->pid != 0 )
|
||||||
process->DeliverSignal(SIGKILL);
|
process->DeliverSignal(SIGKILL);
|
||||||
|
if ( process->init == process )
|
||||||
|
process->is_init_exiting = true;
|
||||||
|
if ( process->firstchild )
|
||||||
|
process = process->firstchild;
|
||||||
|
while ( process && process != this && !process->nextsibling )
|
||||||
|
process = process->parent;
|
||||||
|
if ( process == this )
|
||||||
|
break;
|
||||||
|
process = process->nextsibling;
|
||||||
}
|
}
|
||||||
// NotifyChildExit always signals zombiecond for init when
|
// NotifyChildExit always signals zombiecond for init when
|
||||||
// is_init_exiting is true.
|
// is_init_exiting is true.
|
||||||
|
|
|
@ -27,7 +27,7 @@ or the current process if
|
||||||
.Fa pid
|
.Fa pid
|
||||||
is zero.
|
is zero.
|
||||||
.Pp
|
.Pp
|
||||||
Orphaned descendant processes are reparanted to their init process.
|
Orphaned descendant processes are reparented to their init process.
|
||||||
If an init process exits, all descendant processes atomically receive the
|
If an init process exits, all descendant processes atomically receive the
|
||||||
.Dv SIGKILL
|
.Dv SIGKILL
|
||||||
signal and become unable to create new processes and threads.
|
signal and become unable to create new processes and threads.
|
||||||
|
|
Loading…
Reference in a new issue