On martedì 12 giugno 2007, Sylvain Beucler wrote:
> On Mon, Jun 11, 2007 at 09:26:12PM +0000, Paolo Giarrusso wrote:
> > /bin/bash is running with stding and stdout attached to
> > /dev/console, and on /dev/console ignores Ctrl-* (and that's on
> > purpose, and not UML specific). Possibly just the terminal emulator
> > is noticing the press of Ctrl-C, or it's /dev/console itself.
>
> That explains my problem, thanks. Do you know why that is (maybe so
> that 'init' cannot be killed from keyboard)?
>
> > If you run the open or openvt command, it will run bash on
> > /dev/ttyXXX and there, you'll see that Ctrl-C works.
>
> Alas that doesn't seem to work from rootfstype:
> # openvt /dev/tty0
> Couldnt get a file descriptor referring to the console
> Could not get a file descriptor referring to the console

That may mean that /dev/console couldn't be opened, which is actually 
reasonable (on my system it's owned by root with perms 0600).

Making that usable from uml would bypass this problem (and reads/writes to it 
from UML wouldn't get to the host), but it's not a long-term solution - you 
can maybe debug the problem with strace  (probably /dev/console is just 
opened to switch to the new console).

> I also tried
> # tty
> /dev/console
> # exec < /dev/tty0 > /dev/tty0 2>/dev/tty0
> # tty
> /dev/tty0
>
> But that actually doesn't help.
>
> I'll try to isolate what getty does, as Jeff suggested; apparently it
> registers some signals as well.

I suggested openvt for this - this area is related to session and process 
group management, and involves things like setsid(1) (and setsid(2)) and 
management of the controlling tty (I don't know the tiny details).
-- 
Inform me of my mistakes, so I can add them to my list!
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to