All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [ns_exec] Add SIGCHLD to default clone flags
Date: Fri, 10 Jul 2009 12:58:51 -0500	[thread overview]
Message-ID: <20090710175851.GA26663@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0907101347460.28818-CXF6herHY6ykSYb+qCZC/1i27PF6R63G9nwVQlTi/Pw@public.gmane.org>

Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
> 
> 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.

Thanks Oren.  Since this flags field is also used for the
unshare path, this would actually make that fail.  So instead
of taking this patch, I'm currently unconditionally ORing in
SIGCHLD right before calling clone.

If someone ends up wanting to send something other than SIGCHLD
we'll worry about it when they send a patch I think :)

thanks,
-serge

> 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;

      parent reply	other threads:[~2009-07-10 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090710175851.GA26663@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.