Date: Wed, 13 May 2009 06:01:18 +1000 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Andriy Gapon <avg@icyb.net.ua> Cc: freebsd-arch@freebsd.org Subject: Re: shutdown_nice during boot Message-ID: <20090512200118.GC99304@server.vk2pj.dyndns.org> In-Reply-To: <4A0295E0.4020609@icyb.net.ua> References: <4A01B9A3.2030806@icyb.net.ua> <20090507080048.GA64648@server.vk2pj.dyndns.org> <4A0295E0.4020609@icyb.net.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--adJ1OR3c6QgCpb/j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2009-May-07 11:03:44 +0300, Andriy Gapon <avg@icyb.net.ua> wrote: >on 07/05/2009 11:00 peterjeremy@optushome.com.au said the following: >> On 2009-May-06 19:24:03 +0300, Andriy Gapon <avg@icyb.net.ua> wrote: >>> It's possible to re-enable SIGINT right after init is forked, but >>> this way it will be delivered to init before it installs signal >>> handlers and thus init would simply terminate resulting in "Going >>> nowhere without my init!" panic. >>=20 >> The best option would seem to be for init(8) to call sigprocmask(2) >> immediately it starts up and block all signals. > >But a signal still can be delivered after init is exec-ed and before >sigprocmask(2) is called or not? True - there is still a window there where signal dispositiona are inappropriate. Thinking about it some more, maybe the solution is to change the test in shutdown_nice() - rather than testing for the existence of initproc, it could test a sysctl variable that init sets once it has its signal handlers in place. There's already a kern.shutdown node so maybe "kern.shutdown.via_init". (This adds the option for other subsystems to clear it if desired - maybe as part of a watchdog function). Maybe shutdown_nice should also initiate a 30-60 second timer that invokes boot() whether or not init responds. --=20 Peter Jeremy --adJ1OR3c6QgCpb/j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkoJ1Y4ACgkQ/opHv/APuIfpewCdH3zlfO7bSTzs2YidNvNiTgkl LjcAn0H20zDPn66+QMAgMDJqXnVLXdc+ =u/pD -----END PGP SIGNATURE----- --adJ1OR3c6QgCpb/j--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090512200118.GC99304>