All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel-zvVxMF7wGoXk1uMJSBkQmQ@public.gmane.org>
To: Oleg Nesterov <oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
Cc: Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [Devel] Re: [PATCH 1/3] Signal semantics for /sbin/init
Date: Tue, 18 Sep 2007 09:20:34 +1000	[thread overview]
Message-ID: <87vea8angd.fsf@enki.rimspace.net> (raw)
In-Reply-To: <20070917152411.GB861-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> (Oleg Nesterov's message of "Mon, 17 Sep 2007 19:24:11 +0400")

Oleg Nesterov <oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> writes:
> On 09/14, Daniel Pittman wrote:
>> Oleg Nesterov <oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> writes:
>> > On 09/13, Cedric Le Goater wrote:
>> >> Oleg Nesterov wrote:
>> 
>> [...]
>> 
>> >> To respect the current init semantic,
>> >
>> > The current init semantic is broken in many ways ;)
>> 
>> Yup.  They sure are, but they are pretty set in stone by now. :)
>> 
>> >> shouldn't we discard any unblockable signal (STOP and KILL) sent by a
>> >> process to its pid namespace init process ?  Then, all other signals
>> >> should be handled appropriately by the pid namespace init.
>> >
>> > Yes, I think you are probably right, this should be enough in
>> > practice. After all, only root can send the signal to /sbin/init. On
>> > my machine, /proc/1/status shows that init doesn't have a handler for
>> > non-ignored SIGUNUSED == 31, though.
>> >
>> > But who knows? The kernel promises some guarantees, it is not good to
>> > break them.  Perhaps some strange non-standard environment may suffer.
>> 
>> In this case "strange non-standard environments" would mean anyone
>> running the 'upstart' daemon from recent Ubuntu -- it depends on the
>> current kernel semantics.
>
> Just curious, could you tell more? What "current kernel semantics" do
> you mean?

The semantics where (inside the container) init is protected from a wide
range of unhandled signals by default.

> Do you mean that the 'upstart' daemon sends the unhandled signal to
> init?

Well, yes and no: upstart does not install a handler for several signals
that the traditional sysvinit package uses -- notably, USR1 and USR2
which can trigger reloading of inittab.

The Debian/Ubuntu init scripts still send that signal to the init
process during boot to ensure compatibility with the traditional init
package.

The current kernel semantics ensure that upstart can do nothing and the
unhandled signal does it no harm -- expect, under OpenVZ while getting
Ubuntu working I found that it was not protected and the init script
would simply kill upstart dead.


The upstream developers of upstart feel that the containers should
provide the same semantics as a raw init, and given that an unknown
number of end users will have their own administration systems that
depend on the same assumptions about how init works I tend to agree.


So, upstart never sends itself a signal that it can't handle, but the
rest of the OS environment can.

Regards,
        Daniel

(I tend to think the default protection was a mistake, too, but historic
 mistakes are todays standards. :/ )
-- 
Daniel Pittman <daniel-3AaVwj9c10wJYc8buCWFOBCuuivNXqWP@public.gmane.org>           Phone: 03 9621 2377
Level 4, 10 Queen St, Melbourne             Web: http://www.cyber.com.au
Cybersource: Australia's Leading Linux and Open Source Solutions Company

      parent reply	other threads:[~2007-09-17 23:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11  4:10 [PATCH 1/3] Signal semantics for /sbin/init sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found] ` <20070911041030.GA1264-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-11 11:19   ` Oleg Nesterov
     [not found]     ` <20070911111928.GA123-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
2007-09-13 15:40       ` Cedric Le Goater
     [not found]         ` <46E959EB.2070207-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-09-13 16:58           ` Oleg Nesterov
     [not found]             ` <20070913165820.GA3465-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
2007-09-14  3:00               ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                 ` <20070914030053.GA21242-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-17 15:21                   ` Oleg Nesterov
     [not found]                     ` <20070917152122.GA861-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
2007-09-18 19:00                       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                         ` <20070918190052.GA14030-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-27  3:04                           ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                             ` <20070927030453.GA24451-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-28 10:38                               ` Oleg Nesterov
2007-10-01 17:00                           ` Serge E. Hallyn
     [not found]                             ` <20071001170035.GA10939-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-01 17:47                               ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                                 ` <20071001174720.GB28100-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-01 18:08                                   ` Serge E. Hallyn
     [not found]                                     ` <20071001180849.GA21343-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-05  4:30                                       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                                         ` <20071005043030.GA27787-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-10-08 14:36                                           ` Serge E. Hallyn
     [not found]                                             ` <20071008143649.GA23774-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-08 15:42                                               ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2007-09-14 10:16               ` [Devel] " Daniel Pittman
     [not found]                 ` <87myvpo8le.fsf-kiwxAyAbAnkGAYDEi5AF0l6hYfS7NtTn@public.gmane.org>
2007-09-17 15:24                   ` Oleg Nesterov
     [not found]                     ` <20070917152411.GB861-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
2007-09-17 23:20                       ` Daniel Pittman [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=87vea8angd.fsf@enki.rimspace.net \
    --to=daniel-zvvxmf7wgoxk1umjsbkqmq@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=oleg-6lXkIZvqkOAvJsYlp49lxw@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.