Re: What to do on ctrl-alt-del?

Derek Fawcus (df@eyrie.demon.co.uk)
Wed, 16 Jul 1997 22:44:45 +0100


It would appear that one solution to your problem is to get the init
process to forward the signal to the linuxrc process while it's running.
From looking at the in kernel init code there's a block like this:

pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
if (pid>0)
while (pid != wait(&i));

this could be changed to something like (*) :

pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
if (pid>0)
while (waitpid(-1, &i, WNOHANG) != pid) {
if (current->signal & (1 << SIGINT)) {
kill(pid, SIGINT);
current->signal &= ~(1 << SIGINT);
}
sleep(2);
}

obviously the above will keep waking up and polling again, and could
take a while to notice a signal (or the exit of linuxrc), however as this
will only run for a while at system start up it shouldn't be too bad.

(*) The code will almost certainly have to be changed to run correctly
in kernel mode, but it gives you the gist of the idea.

DF

-- 
Derek Fawcus                                        df@eyrie.demon.co.uk