[BRLTTY] screen startup before login
Nicolas Pitre
nico at fluxnic.net
Fri Nov 23 12:57:36 EST 2012
On Fri, 23 Nov 2012, raoul megelas wrote:
> #!/bin/tcsh
>
> /usr/local/bin/screen -dm # daemon in detached mode
> /bin/brltty -q -b fs -d usb:
>
> and brltty starts now but does not display the login.
> i mean the braille display shows a #
That's most probably a shell prompt.
> after blindly ligin (as before)
> i do:
> sudo screen -x to attach the screen to terminal.
> and brltty connect fine but as root!
>
> what i need to know is to automate a procedure
> when logged.
> i tried several things in .tcshrc but this does not work.
> i do not know how to do that.
> perhaps you can help.
What screen does is to create a pseudo terminal interface which is
different from all the terminals where the system normally start a login
process on. For example, on linux the normal login process is attached
to /dev/tty1, /dev/tty2, etc. When screen executes, it
dynamically creates /dev/pts/0, /dev/pts/1, etc. On BSD those device
nodes probably have different names but the principle is the same. So
what screen sees is the activity that goes via those /dev/pts/* devices,
and that's not where the login processes are. By default, screen simply
starts a shell, hence the # that you see.
What you could do is to replace the getty process normally attached to
the console (/dev/tty1 on Linux) which is responsible for setting up
things and providing a login prompt. This used to be in /etc/inittab on
Linux but maybe BSD still uses that.
Then, you can specify a specific program to execute instead of the
default shell. Something like:
screen -s login
However, on Linux at least, that works only if screen is executed as
root. As you want to do this when booting the system that should be
fine. Then you need to attach this screen process to the proper console
device. See the WINDOW TYPES section in the screen man page.
Note that I never attempted any of the above myself, except for trying
out "screen -s login" as root. Once you start playing with the system
login setup, you risk locking yourself out of your system if something
is not working properly. So make sure you have alternative methods,
such a rescue boot disk, in order to get back into your filesystem to
fix things if need be. But I don't see how this couldn't be made to
work.
Nicolas
More information about the BRLTTY
mailing list