All of lore.kernel.org
 help / color / mirror / Atom feed
* [ns_exec] Add SIGCHLD to default clone flags
@ 2009-07-10 17:52 Oren Laadan
       [not found] ` <Pine.LNX.4.64.0907101347460.28818-CXF6herHY6ykSYb+qCZC/1i27PF6R63G9nwVQlTi/Pw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Oren Laadan @ 2009-07-10 17:52 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: Containers


This is the default behavior. Without it, the process will not
report/be reported to the parent on a normal wait() call. Instead
the parent will need to use __WALL wait flag.

This caused a nasty bug where running 'rstr' from a checkpoint
image of a process executed with ns_exec would cause the shell
to skip to the next line in the script without waiting for the
restarted task to terminate, contrary to one's expectation.

TODO: if someone would like to run with anything else than the
SIGCHLD there, then add an option to ns_exec to allow it.

Oren.


diff --git a/ns_exec.c b/ns_exec.c
index 3c3aa9e..0d2f54a 100644
--- a/ns_exec.c
+++ b/ns_exec.c
@@ -219,7 +219,7 @@ void write_pid(char *pid_file, int pid)
 int main(int argc, char *argv[])
 {	
 	int c;
-	unsigned long flags = 0, eflags = 0;
+	unsigned long flags = SIGCHLD, eflags = 0;
 	char ttyname[256];
 	int status;
 	int ret, use_clone = 0;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-10 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-10 17:52 [ns_exec] Add SIGCHLD to default clone flags Oren Laadan
     [not found] ` <Pine.LNX.4.64.0907101347460.28818-CXF6herHY6ykSYb+qCZC/1i27PF6R63G9nwVQlTi/Pw@public.gmane.org>
2009-07-10 17:58   ` Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.