[lxc-devel] [PATCH 2/2] Revert "start: Detect early failure of the new child"

Stéphane Graber stgraber at ubuntu.com
Thu Apr 18 08:34:02 UTC 2013


On 04/18/2013 10:32 AM, Stéphane Graber wrote:
> This reverts commit 5a5c35c3a01afec515e688c8366e6f893985518d.
> 
> This commit was preventing startup of containers using lxc hooks and
> shutdown of all other containers, requiring the use of a good old
> kill -9 to get rid of lxc-start after a container shutdown.
> 
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Was directly applied to the staging branch as the issue was preventing
regular use of LXC.

> ---
>  src/lxc/start.c | 28 ----------------------------
>  1 file changed, 28 deletions(-)
> 
> diff --git a/src/lxc/start.c b/src/lxc/start.c
> index a58737a..aefccd6 100644
> --- a/src/lxc/start.c
> +++ b/src/lxc/start.c
> @@ -198,7 +198,6 @@ static int setup_signal_fd(sigset_t *oldmask)
>  	    sigdelset(&mask, SIGILL) ||
>  	    sigdelset(&mask, SIGSEGV) ||
>  	    sigdelset(&mask, SIGBUS) ||
> -	    sigdelset(&mask, SIGCHLD) ||
>  	    sigprocmask(SIG_BLOCK, &mask, oldmask)) {
>  		SYSERROR("failed to set signal mask");
>  		return -1;
> @@ -740,29 +739,10 @@ int save_phys_nics(struct lxc_conf *conf)
>  	return 0;
>  }
>  
> -static void sigchild_handler(int sig)
> -{
> -	int status;
> -	pid_t child;
> -
> -	child = wait(&status);
> -	if (child < 0) {
> -		SYSERROR("SIGCHLD caught but wait() failed: %m\n");
> -		return;
> -	}
> -
> -	if (WIFSIGNALED(status))
> -		ERROR("Process in the new namespace died before execve()"
> -		      " due to signal: %i", WTERMSIG(status));
> -	else if (WIFEXITED(status))
> -		ERROR("Process in the new namespace died before execve()"
> -		      " with exit code: %i", WIFEXITED(status));
> -}
>  
>  int lxc_spawn(struct lxc_handler *handler)
>  {
>  	int failed_before_rename = 0;
> -	struct sigaction act;
>  	const char *name = handler->name;
>  
>  	if (lxc_sync_init(handler))
> @@ -813,14 +793,6 @@ int lxc_spawn(struct lxc_handler *handler)
>  		goto out_delete_net;
>  	}
>  
> -	/*
> -	 * Install a SIGCHLD handler to detect the death of the new child between
> -	 * clone() and execve().
> -	 */
> -	memset(&act, 0, sizeof(act));
> -	act.sa_handler = sigchild_handler;
> -	sigaction(SIGCHLD, &act, NULL);
> -
>  	/* Create a process in a new set of namespaces */
>  	handler->pid = lxc_clone(do_start, handler, handler->clone_flags);
>  	if (handler->pid < 0) {
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130418/1d7b3717/attachment.pgp>


More information about the lxc-devel mailing list