vzctl start: do not start half-configured environment
During vzctl start, vzctl creates a new environment (a CT), then forks.
The child sits inside the new environment and waits for the parent
to finish configuring the environment (setting UBCs, quotas etc.)
and send an "OK to go" signal. Child then execs /sbin/init.
That "OK to go" signal is closing a specific file descriptor
without sending anything via it, while "no go" signal is sending some
error code. The problem is in case the parent segfaults, the kernel closes
this fd and so the child thinks that everything is fine and runs init.
This patch changes the logic: now "no go" signal is just closing fd, while
"good to go" is actually sending something to that fd.
The issue was found because of OpenVZ bug #1729.
Limited testing revealed no problems with the patch.
http://bugzilla.openvz.org/1732
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed