From 2a4b78e7e27677d21dff21b6629c1a8575119ed3 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 1 Mar 2013 09:02:26 +0100 Subject: [PATCH] pid_namespaces.7: Mention PR_SET_CHILD_SUBREAPER in discussion of reparenting to init Reported-by: Vasily Kulikov Signed-off-by: Michael Kerrisk --- man7/pid_namespaces.7 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/man7/pid_namespaces.7 b/man7/pid_namespaces.7 index 55d2d1ef7..c51019905 100644 --- a/man7/pid_namespaces.7 +++ b/man7/pid_namespaces.7 @@ -60,9 +60,14 @@ using the .BR CLONE_NEWPID flag) has the PID 1, and is the "init" process for the namespace (see .BR init (1)). -Children that are orphaned within the namespace will be reparented +A child process that is orphaned within the namespace will be reparented to this process rather than -.BR init (1). +.BR init (1) +(unless one of the ancestors of the child + in the same PID namespace employed the +.BR prctl (2) +.B PR_GET_CHILD_SUBREAPER +command to mark itself as the reaper of orphaned descendant processes). If the "init" process of a PID namespace terminates, the kernel terminates all of the processes in the namespace via a