Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2006 05:16:03 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Delivering SIGKILL to init
Message-ID:  <20060919191603.GA3318@turion.vk2pj.dyndns.org>
In-Reply-To: <20060919075550.GB720@turion.vk2pj.dyndns.org>
References:  <20060919075550.GB720@turion.vk2pj.dyndns.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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.

-- 
Peter Jeremy

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFEEHz/opHv/APuIcRAuQFAKCLG3VswKgMGDiHhwvszsnV8viIpQCgsCfg
a4+oW1rN4zernsNkZSKwnTg=
=IskI
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060919191603.GA3318>