From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [PATCH 8/9] signal: Drop signals before sending them to init. Date: Thu, 13 Dec 2007 11:50:09 -0700 Message-ID: References: <20071213162502.GB219@tv-sign.ru> <20071213181802.GA486@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <20071213181802.GA486-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> (Oleg Nesterov's message of "Thu, 13 Dec 2007 21:18:02 +0300") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oleg Nesterov Cc: Linux Containers , Andrew Morton , Pavel Emelyanov List-Id: containers.vger.kernel.org Oleg Nesterov writes: > OK, if we change the semantics for /sbin/init signals we can avoid > a lot of problems, Yes. Otherwise we must track the source of the signals. >> No. We should treat signals that we process for /sbin/init completely >> normally. > > ... including this one. I am not arguing. > >> This gives /sbin/init completely normal signal handling if the signal is >> ever enqueued. Something trivial to implement and explain. > > Well, I am not sure about "explain" though. Unless I missed something > this makes the semantics a bit special. Well the semantics are a bit special for init period. I just make them special in a slightly different way. > Suppose that init does sigtimedwait() but the handler == SIG_DFL. Yes that is a bit surprising. However it is still easy to explain. The signal is never enqueued so sigtimedwait never gets the chance to do anything with it. Interestingly enough this is not a problem for the current sysvinit. sysvinit does this at start up: /* * Ignore all signals. */ for(f = 1; f <= NSIG; f++) SETSIG(sa, f, SIG_IGN, SA_RESTART); So everything is initialized to SIG_IGN by userspace, in the common case. Which means none of this special case logic will actually kick in, except for SIGKILL and SIGSTOP. The signals we can't change. Eric