From: Rob Landley <rob@landley.net>
To: Blaisorblade <blaisorblade@yahoo.it>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Any way to give /dev/console a controlling TTY?
Date: Fri, 23 Sep 2005 14:08:32 -0500 [thread overview]
Message-ID: <200509231408.32522.rob@landley.net> (raw)
In-Reply-To: <200509231950.32370.blaisorblade@yahoo.it>
On Friday 23 September 2005 12:50, Blaisorblade wrote:
> On Friday 23 September 2005 18:35, Rob Landley wrote:
> > I'm the strange guy using UML via the stdio console, ala:
> >
> > ./linux rootfstype=hostfs MEM=48m rw init=/bin/sh
>
> Ah, init=/bin/sh, that's why you have /dev/console.
Yup. Very useful thing to do with UML, I've found. (That or
init=/some/shell/script.sh, although it has the nasty habit of falling back
to /sbin/init if that file is not found...)
Unfortunately, when you do wrap a shell script, ctrl-c won't get you out.
> I feared somebody again using /dev/console in inittab.
Nope, trying to wrap a shell script in a UML instance so I can build and link
against a libc with more recent kernel headers than the kernel the parent
system is running. (Otherwise I get segfaults when the libc tries to do
things the parent kernel doesn't support.)
P.S. The failure case i reported earlier (where 2.6.11 works but 2.6.13.1
doesn't) involves building the busybox "install" command against uclibc.
That seems to be what's failing. I'm still trying to narrow down the
reproduction case to something small enough to attach to the list, but it's
been a busy week...)
> > LD_ASSUME_KERNEL=2.4.1
> >
> > And it would be very nice if ctrl-c would work with that. I tried
> > commenting out the "!noctty &&" test in line 1872, but it didn't make any
> > difference.
> >
> > Anybody see an obvious way to make /dev/console a controlling TTY?
>
> Guess that /dev/console is not a TTY, so that it not possible. I mean,
> you'd have to patch (uselessly) the very TTY core layer.
Well, actually the test on line 1872 of drivers/char/tty_io.c does in fact
seem to be trying to determine what should and shouldn't be a tty.
It _seems_ like that code is trying to figure out what is and isn't a
controlling tty:
if (!noctty &&
current->signal->leader &&
!current->signal->tty &&
tty->session == 0) {
task_lock(current);
current->signal->tty = tty;
task_unlock(current);
current->signal->tty_old_pgrp = 0;
tty->session = current->signal->session;
tty->pgrp = process_group(current);
}
The first test is the one I commented out, and I guess one of the next 3 tests
is still blocking it...
> Or make Linux use /dev/tty0 instead of /dev/console when starting init -
> which is simpler. There is maybe even a console= switch
There is indeed a console= switch, but I haven't found a way to get it to do
anything useful. (when I use console=/dev/tty0 it immediately exits with no
error message. Same for console=4,1. Strangely, console=tty0 boots, but
seems to be a NOP.)
> What about something like init="kludgy script which calls, say, a mixture
> of setsid, <> /dev/tty0, open(1) and such stuff to make sh start?
Given enough effort I can workaround the problem instead of fixing it, sure.
> Maybe sh doesn't even need that, but login(8) needs setsid. I never
> remember the exact combination, however.
The necessary magic is in the busybox init.c, but I don't see how it applies
here...
Rob
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2005-09-24 13:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-23 16:35 [uml-devel] Any way to give /dev/console a controlling TTY? Rob Landley
2005-09-23 17:50 ` Blaisorblade
2005-09-23 19:08 ` Rob Landley [this message]
2005-09-24 14:09 ` Blaisorblade
2005-09-25 12:49 ` Henrik Nordstrom
2005-09-25 15:34 ` Rob Landley
2005-09-23 18:31 ` Rob Landley
2005-09-23 18:56 ` Henrik Nordstrom
2005-09-23 19:08 ` Blaisorblade
2005-09-23 20:31 ` Henrik Nordstrom
2005-09-24 14:03 ` Blaisorblade
2005-09-24 17:37 ` Rob Landley
2005-09-24 23:14 ` Henrik Nordstrom
2005-09-25 0:10 ` Rob Landley
2005-09-24 14:43 ` Rob Landley
2005-09-23 18:47 ` Henrik Nordstrom
2005-09-23 18:53 ` Blaisorblade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200509231408.32522.rob@landley.net \
--to=rob@landley.net \
--cc=blaisorblade@yahoo.it \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.