On Tue, Jun 12, 2007 at 07:42:13PM +0200, 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
> 
> 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.

Actually the crucial part appears to be setsid().
(Otherwise "ps" doesn't show tty0 as the process' TTY.)

It works now, C-c,C-\,C-z work directly :)
I don't know exactly why setsid is necessary though :/

-- 
Sylvain


> > ----- Messaggio originale -----
> > Da: Sylvain Beucler <[EMAIL PROTECTED]>
> > A: user-mode-linux-user@lists.sourceforge.net
> > Inviato: Lunedì 11 giugno 2007, 22:16:25
> > Oggetto: [uml-user] C-c/sig.intr is caught
> > 
> > Hi,
> > 
> > I'm working on 'umdo', i.e. sudo with User-Mode Linux (attached).
> > 
> > I use the rootfstype=hostfs command line option. I notice, though,
> > that C-c, C-\ and C-z (at least) do not work. I'm puzzled because the
> > key events _are_ sent to the UML-jailed process, yet the signal is
> > somehow blocked.
> > 
> > Example: let's run "cat" from a UML'd bash, then press C-c, then C-h,
> > then C-d (to quit "cat"):
> > 
> > $ linux rootfstype=hostfs rw quiet init=/bin/bash
> > root@(none):/# cat
> > ^H
> > root@(none):/# stty intr ^H
> > root@(none):/# cat
> > ^C
> > root@(none):/# stty intr ^I
> > root@(none):/# cat
> > ^C^H
> > 
> > Notice that each time, they key associated with 'intr' is caught
> > sowewhere.
> > 
> > Idem for C-\ (quit)
> > Idem for C-z (susp)
> > C-s (stop), C-q (start), C-d (eof) do work, though.
> > 
> > 
> > There's more: running through 'getty' enables C-c and C-\
> > But C-z is still disabled:
> > 
> > $ linux rw rootfstype=hostfs quiet init=/sbin/getty -inl /bin/bash 38400 
> > tty0
> > root@(none):/# cat
> > root@(none):/#  # C-c worked.
> > 
> > 
> > How can I enable all key shortcuts in a uml?
> > Do you know what is the cause of this behavior?
> > 
> > Thanks,

Attachment: umdo.sh
Description: Bourne shell script

-------------------------------------------------------------------------
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