From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 19 19:16:06 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4919A16A403 for ; Tue, 19 Sep 2006 19:16:06 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93A3F43D49 for ; Tue, 19 Sep 2006 19:16:05 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail17.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k8JJG3we002368 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 20 Sep 2006 05:16:04 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k8JJG3R9003356 for ; Wed, 20 Sep 2006 05:16:03 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k8JJG3LT003355 for freebsd-hackers@freebsd.org; Wed, 20 Sep 2006 05:16:03 +1000 (EST) (envelope-from peter) Date: Wed, 20 Sep 2006 05:16:03 +1000 From: Peter Jeremy To: freebsd-hackers@freebsd.org Message-ID: <20060919191603.GA3318@turion.vk2pj.dyndns.org> References: <20060919075550.GB720@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20060919075550.GB720@turion.vk2pj.dyndns.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.12-2006-07-14 Subject: Re: Delivering SIGKILL to init X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2006 19:16:06 -0000 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 2006-Sep-19 17:55:50 +1000, Peter Jeremy wrote: >Prompted by some discussion elsewhere, I've been trying to send >SIGKILL to init. If I ktrace kill(1), I can see "kill(1,9)" which >returns 0 but the signal is never delivered. If I sent (eg) SIGXCPU >then init dies and the kernel panics (as expected). I've looked >through sys/kern/kern_* and can't see anywhere that special cases >the delivery of SIGKILL to init. For anyone else interested: I was pointed to code in kern_sig.c:issignal() by a friend. The signal action handling switch (about line 2172 in -stable) ignores any signals marked SIG_DFL for "system" processes (those with a PID of 1 or less). Since SIGKILL is marked SIG_DFL (because it can't be changed), this means SIGKILL isn't delivered. SIGXCPU (and a variety of other signals) have a handler defined by init so they aren't SIG_DFL and therefore are delivered. --=20 Peter Jeremy --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFEEHz/opHv/APuIcRAuQFAKCLG3VswKgMGDiHhwvszsnV8viIpQCgsCfg a4+oW1rN4zernsNkZSKwnTg= =IskI -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--