lkml.org 
[lkml]   [1997]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: What to do on ctrl-alt-del?
   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

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