Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!bloom-beacon!mit-eddie!killer!jfh From: jfh@killer.UUCP (The Beach Bum) Newsgroups: comp.unix.xenix Subject: Re: Automatic Login with Multiscreens Summary: you need to set up a new process group and controlling terminal Keywords: login, multiscreens, SCO XENIX-286 2.2 Message-ID: <3619@killer.UUCP> Date: 8 Mar 88 02:09:35 GMT References: <10538@mimsy.UUCP> <9785@steinmetz.steinmetz.UUCP> Reply-To: jfh@killer.UUCP (The Beach Bum) Organization: Big "D" Home for Wayward Hackers Lines: 37 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 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