[lkml]   [1998]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: kill -9 <pid of X>

On Wed, 12 Aug 1998, Kenneth Albanowski wrote:
> May I therefore ask (as devil's advocate, please realize) why the kernel
> prevents init from receiving unwanted signals? Surely there is no reason
> root shouldn't be able to SIGKILL init, as you "could have killed the
> machine in easier ways", and we seem to be talking about the same level of
> mistake (accidentally killing the wrong process).

The reason I originally did this was simply that we didn't even have a
login program at all, the kernel just booted straight into a root shell.

And when things are unstable, it's really convenient to do a "kill -1" as
root to get rid of _everything_ (the kernel would just continue to respawn
the shell when the old one died). But you want to protect init, because
init is really special.

Init is not special because it knows about "runlevels" or any of that
stuff. That's something the kernel doesn't care about, never has, never
will. If init did just that, the kernel would be happy to kill it off.

Init is special because it inherits other peoples children. It's the only
process the kernel really cares about, because it's really the only
process that the kernel uses itself (see kernel/exit.c and search for "/*
init */").

And yes, I could remove that these days. Anybody who does "kill -1" as
root these days gets whatever he asked for. However, there's a large
difference between implementing a large subsystem like some have proposed
for graphics, and removing benign logic.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:44    [W:0.279 / U:1.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site