Re: VC switching during install


Subject: Re: VC switching during install
From: Erik Andersen (andersen@xmission.com)
Date: Tue Jan 18 2000 - 00:59:57 CET


On Mon Jan 17, 2000 at 03:12:49PM -0800, Karl M. Hegbloom wrote:
>
> The other day I used the 2.2.4 rescue/base disks to install a
> masquerading proxy DSL gateway. At one point during the
> installation, I switched virtual consoles to look at the log
> messages.
>
> The install program updated its screen, and wrote to the console I
> had switched to, rather than to vc1 where it was running. That is,
> the screen turned blue with a dialog up.
>
> I'm sorry, but I cannot recall just exactly what phase of the
> installation I was at, and did not jot it down then.
>
> When I typed, I saw nothing; I switched back to vc1 and the screen
> wasn't right, the things I'd typed had been written there, and
> pushing C-l didn't redraw.
>
> I've got nothing better to do today but read books or code... I'm
> going to see if I can find the relevant code and whether I can
> understand it well enough to try and find the problem. Don't count
> on me to fix anything.

Sounds like an explicit usage of "/dev/console" somewhere.
Anybody wanting to use /dev/console should be using something
like:

    struct vt_stat vt;
    char console[32] = "/dev/null";

    if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
        /* this is a serial console */
        snprintf(console, sizeof(console)-1, "/dev/ttyS%d", sr.line);
    }
    else if (ioctl(0, VT_GETSTATE, &vt) == 0) {
        /* this is linux virtual tty */
        snprintf(console, sizeof(console)-1, "/dev/tty%d", vt.v_active);
    } else {
        snprintf(console, sizeof(console)-1, "%s", _PATH_CONSOLE);
        tried_devcons++;
    }

If it gets to setting console to _PATH_CONSOLE (i.e. "/dev/console")
then bad things will happen when switching VTs while proceeses
that display things to /dev/console are running on other VTS...

Does that make things at all clear?

 -Erik

--
Erik B. Andersen   Web:    http://www.xmission.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

-- To UNSUBSCRIBE, email to debian-boot-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



This archive was generated by hypermail 2b25 : Tue Jan 18 2000 - 01:07:16 CET