CLONE_PARENT in a container
sukadev at linux.vnet.ibm.com
Thu Mar 19 19:07:49 PDT 2009
Cc: Oleg, Eric
Oren Laadan [orenl at cs.columbia.edu] wrote:
| What happens when a container-init calls clone() with the
| CLONE_PARENT flag set ?
| Since CLONE_PARENT can be used to create a sibling, I'd
| think that this will create a sibling, in particular, a
| new task in the same container whose parent is the parent
| of the container. From a quick look in the code I can't
| see why this would be impossible.
| Is this so ? Is this the desired behavior ?
Good question. CLONE_PARENT was discussed recently on lkml but did
not look obvious to me who uses it or what the semantics are.
- the "reaper" for this sibling would be the reaper of the
parent container, not the init of the new container.
- if container-init exits, this sibling will also be killed since
it has a pid in this container.
Not sure if it needs to be prevented though. An using CLONE_PARENT
may want to run as a container-init :-) And if CLONE_PARENT is used
with CLONE_THREAD, we don't want to preclude threaded container-inits.
More information about the Containers