[comp.unix.xenix] Automatic Login with Multiscreens

meyer@mimsy.UUCP (John R. Meyer) (03/04/88)

Hello --

	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 run SCO XENIX-286 2.2 on an IBM PC-AT.


					Thanks,

						John
						meyer@mimsy.umd.edu
-- 
John R. Meyer					Domain: meyer@mimsy.umd.edu
10208C Ashbrooke Ct.				Path:   uunet.uu.net!mimsy!meyer
Oakton, VA  22124				Phone:  (703) 644-3944 (O)
Disclaimer:  The views expressed are my own.		(703) 281-5157 (H)

davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) (03/04/88)

In article <10538@mimsy.UUCP> meyer@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. I just gave up and implemented a hack that allows me
to sign in on a number of VT's and kill them all when the master login
ends. This allows me to live with the problem, although I would really
like to do just what you said.
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

jfh@killer.UUCP (The Beach Bum) (03/08/88)

In article <9785@steinmetz.steinmetz.UUCP> davidsen@crdos1.UUCP (bill davidsen) writes:
>In article <10538@mimsy.UUCP> meyer@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