lkml.org 
[lkml]   [1998]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: kill -9 <pid of X>
Date
From
> If I boot with init=/bin/bash and mount /proc so I can see what's
> happening, bash is called "init" and it is pid 1 as expected.
> If I attempt to kill it, nothing happens because, by default, the
> kernel will not send a signal 9 to pid 1. However, I can exit and
> be left with nothing. In other words, if init exits, the kernel doesn't
> automatically start another.

Linux 0.11 had this behaviour too. Back then there was no init and
what the kernel started was /bin/sh. When you logged out you had to
reboot.

Linux 0.12 then added code to the end of init/main.c which loops,
forking off /bin/sh as soon as the old one dies. This is in effect a
micro-version of init. It runs in user mode as task 1 and pid 1.

This code is still present as a fall-back in 2.0.* and used when none
of /bin/init, /etc/init, /sbin/init exists or the boot argument "init"
is given.

In 2.1 it was taken out. Apparently someone decided that nowadays
everyone runs init, it isn't necessary any more. As the above shows,
this reasoning is not exactly true. So we're back to 0.11 here ;-)

olaf


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

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