From owner-freebsd-arch@FreeBSD.ORG Tue May 12 20:01:25 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36AF01065691 for ; Tue, 12 May 2009 20:01:25 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au [211.29.133.218]) by mx1.freebsd.org (Postfix) with ESMTP id B952C8FC21 for ; Tue, 12 May 2009 20:01:24 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-216-167.belrs3.nsw.optusnet.com.au [122.106.216.167]) by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n4CK1K66025601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 May 2009 06:01:22 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n4CK1Joh071888; Wed, 13 May 2009 06:01:19 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n4CK1IGO071887; Wed, 13 May 2009 06:01:18 +1000 (EST) (envelope-from peter) Date: Wed, 13 May 2009 06:01:18 +1000 From: Peter Jeremy To: Andriy Gapon Message-ID: <20090512200118.GC99304@server.vk2pj.dyndns.org> References: <4A01B9A3.2030806@icyb.net.ua> <20090507080048.GA64648@server.vk2pj.dyndns.org> <4A0295E0.4020609@icyb.net.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="adJ1OR3c6QgCpb/j" Content-Disposition: inline In-Reply-To: <4A0295E0.4020609@icyb.net.ua> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.19 (2009-01-05) Cc: freebsd-arch@freebsd.org Subject: Re: shutdown_nice during boot X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 20:01:25 -0000 --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 wrote: >on 07/05/2009 11:00 peterjeremy@optushome.com.au said the following: >> On 2009-May-06 19:24:03 +0300, Andriy Gapon 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--