Re: Delivering SIGKILL to init



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



Relevant Pages

  • Re: [PATCH] kill_something_info: dont take tasklist_lock for pid==-1 case
    ... (and the thread group of the current process, ... If kill(-1, SIGKILL) finish before the ... the process forked by init appears on the ->tasks list ... Process group and session signals need to be delivered to just the ...
    (Linux-Kernel)
  • Re: [PATCH] kill_something_info: dont take tasklist_lock for pid==-1 case
    ... Does that fix only apply when we have a specific pid, ... Actually we do sent the signal to init but we shouldn't, ... The guarantee is that the signal delivery needs to appear atomic ... Init only receives signals that it wants (the rest are effectively ...
    (Linux-Kernel)
  • Re: Can init process ignore SIGKILL ?
    ... "init is a special process: it does not get signals that it does not ... it can ignore a SIGKILL. ... basically ignores signals it doesn't want, even send from the superuser. ...
    (comp.unix.programmer)
  • Can init process ignore SIGKILL ?
    ... But going through the article description of SIGKILL in wikipedia, ... "init is a special process: it does not get signals that it does not ...
    (comp.unix.programmer)
  • Delivering SIGKILL to init
    ... SIGKILL to init. ... If I ktrace kill, I can see "kill" which ... the delivery of SIGKILL to init. ...
    (freebsd-hackers)