[comp.unix.wizards] i/o redirection to a non-getty tty?

rwl@umree.UUCP (07/12/88)

INTRO
I would like to allow i/o redirction to some graphics terminals & other
devices for display purposes from some regular ascii terminals.
e.g. "graphics_program > /dev/ttyxx"

THE PROBLEM
If the getty is on, it often munches the input mistaking it for a login.
If the getty is turned off, nothing gets through.  (Note: I have been able to
output with the getty off with a setuid root program that explicitly opens the
device, but I would like just to use the normal csh i/o redirection: > & < .)
The present *kludge* (see below) requires manual intervention after each reboot.

THE PRESENT KLUDGEY SOLUTION (from a public domain cad package from ucb)
(I'm not complaining, its crude but effective...)
Login with user id "sleeper", which runs a simple C program which sleeps.
The guts of the C program are:
	chmod(ttyname(1),0666);
	while(1) sleep(200000);
Here's the line from the password file:
sleeper::199:199:Beautiful Dreamer,,,,0018:/usr/cad:/usr/cad/bin/sleeper
(There's also a .hushlogin file in the home dir.)


A BETTER SOLUTION
Does anyone know how to do this elegantly?  I'd even settle for crudely
if it was automated.

Please reply directly & I'll be happy to summarize replies back to the group.

advTHANKSance,
Wayne Little
rwl@umree.UUCP
rwl@UMRUNIXA.BITNET

vandys@hpisoa1.HP.COM (Andrew Valencia) (07/14/88)

/ hpisoa1:comp.unix.wizards / rwl@umree.UUCP /  9:20 am  Jul 12, 1988 /

	If I understand what you're doing (unlikely, admittedly :->),
your problem is that the initial baud rate of the TTY port (i.e., the
value it is set to on every initial open) isn't what you're expecting.
It's probably 300 baud, whereas your terminal wants 9600 or more.  Open
the TTY without modem control (for instance, on XENIX it's tty<num>a
instead of tty<num>A), then do an ioctl() to set the baud rate and other
parameters.  termio(7) will give you the details.  I have a simple terminal
routine which I use to connect out of a TTY port on System V--if you'd
like it as a starting point, drop me a note.  If you're running BSD 4.2/4.3,
then perhaps someone else can jump in, as I no longer have access to that
worthy.
			Good luck!
			Andy Valencia
			...!hplabs!hpisoa1!vandys