Delivering SIGKILL to init
Peter Jeremy
peterjeremy at optushome.com.au
Tue Sep 19 12:16:06 PDT 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060919/daa3ffbe/attachment.pgp
More information about the freebsd-hackers
mailing list