Hi Richard.
> I have this vague notion that the first and second TERM and KILL
> signals are switching from runlevel, er, whatever normal is, to
> 6, and then down to, er, maybe 0 or something...
> But then, I've only been running Linux for a day or two.
Actually, that part of the procedure is as follows:
1. The shutdown script sends SIGTERM to each running process. This
is interpreted by most daemons to mean "You are to shut down
gracefully, but as soon as possible", and the daemon does its
best to do so. Most non-daemon processes just die at this point.
2. The shutdown script waits X seconds to give the process time to
shut itself down. By default, this is 5 seconds, but experience
has shown that this sometimes needs increasing to 7 seconds.
3. The shutdown script sends SIGKILL to each process that is still
running. The Linux kernel interprets SIGKILL itself, and uses it
to effectively pull the plug under the process in question. The
process itself never sees SIGKILL.
The idea behind this is to give the process a chance to shut itself
down, but to enforce a shutdown on recaltrant processes so that the
requested system shutdown/reboot can complete.
Best wishes from Riley.
+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html