Automatic Login with Multiscreens
The Beach Bum
jfh at killer.UUCP
Tue Mar 8 12:09:35 AEST 1988
In article <9785 at steinmetz.steinmetz.UUCP> davidsen at crdos1.UUCP (bill davidsen) writes:
>In article <10538 at mimsy.UUCP> meyer at mimsy.UUCP (John R. Meyer) writes:
>| [...]
>| I would like to be able to boot my SCO XENIX-286 2.2 system
>| and automatically have certain users logged in on multiscreens
>| 9-12. Does anyone have any idea how I can do this?
>
> I can give you half a solution... in the .profile you can start
>another copy of shell which is running on the other virtual terminal.
>The line looks like:
> /bin/sh </dev/tty10 >/dev/tty10 2>&1 &
>
> The problem (I *said* it was half a solution) is that the interrupt
>key doesn't work.
the reason for that is the tty driver doesn't know which process group
to send the signals to. the first process to open a tty becomes the
process group leader (i'm skipping details here) for interrupts and
quits. when a keyboard interrupt is received, the entire group receives
the signal.
so, you need to disassociate yourself from a process group, using the
setpgrp() call. first, close all of the files, which will close your
terminal. then, fork yourself into the background (just for the fun
of it). then, open the standard file descriptors 0, 1, and 2 from the
new port, which _MUST_ not have any other opens active.
now, that process group is the controlling group for the tty and will
receive the signals from the keyboard. an exec() is order right about
now to overlay the current process with a login shell or whatever.
- john.
--
John F. Haugh II SNAIL: HECI Exploration Co. Inc.
UUCP: ...!ihnp4!killer!jfh 11910 Greenville Ave, Suite 600
"You can't threaten us, we're Dallas, TX. 75243
the Oil Company!" (214) 231-0993 Ext 260
More information about the Comp.unix.xenix
mailing list