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
pgpqhYltrBM2I.pgp
Description: PGP signature