Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!olivea!apple!mips!moosehead.mips.com!trevc From: trevc@moosehead.mips.com (Trevor Cotton) Newsgroups: comp.sys.mips Subject: Re: uugetty and /usr/spool/locks Message-ID: <44863@mips.mips.COM> Date: 15 Jan 91 00:59:50 GMT References: <9101111107.AA09005@fernwood.mpk.ca.us> Sender: news@mips.COM Reply-To: trevc@moosehead.mips.com (Trevor Cotton) Lines: 84 In article , lgy@phys.washington.edu (Laurence G. Yaffe) writes: > jns@fernwood.mpk.ca.US (Jerry Sweet) writes: > > > -For me, this note applies to RISC/os 4.51 on an RC3230. > > -The man page for uugetty, as well as the Nutshell handbook, leads one > -to believe that uugetty will "step aside" for other processes that > -wish to use a modem port for which a uugetty process is awaiting login > -(presumably via "respawn" in the inittab). This appears not to be the > -case. Uugetty, while waiting for login, leaves a lock file in > -/usr/spool/locks. > > -The question is: how does one properly make the alleged "step-aside" > -feature of uugetty happen? [Various possibilities deleted] > > I posted the same query about 6 months ago and someone (I forget who - > sorry!) reminded me that uugetty's from versions of RISC/os earlier than 4.50 > seem to work better than the current released version. I believe I'm now using > a 4.31 version. > > -- > -------------------------------------------------------------------------- > Laurence G. Yaffe Internet: lgy@newton.phys.washington.edu > University of Washington Bitnet: yaffe@uwaphast.bitnet The trick is to set up your modem so that DCD is off until a carrier is detected from the remote host. Use a line with modem control ( stty -clocal ) uugetty will then block until it detects a carrier, at which point it will create the lock file. The RISC/os 4.50 release notes explain which MIPS serial lines support modem control, and example cables to use. Here are the introductory notes from the source that give more detail. /* This program, when compiled as uugetty, is the */ /* standard getty modified */ /* to allow a tty line to be used by uucp/cu/tip or a dial in. */ /* For it to work with 801/212 dialers, */ /* put an entry into inittab like */ /* 30:2:respawn:/usr/lib/uucp/uugetty -t 60 ttymh4 1200 */ /* For direct lines, or intelligent modems use */ /* 30:2:respawn:/usr/lib/uucp/uugetty -r -t 60 ttymh4 9600 */ /* When this line is used, the Systems file that is */ /* used to call into it must have the following script */ /* "" \r\d\r\d\r\d\r in:--in: ... */ /* This is because the uugetty expects to read a character */ /* before the login message is output. */ /* It will only work on systems that permit kill(0, pid). */ /* This scheme was proposed by Larry Wehr and works as follows: */ /* The fopen of the line hangs until carrier is detected. */ /* At this point, uugetty attempts to create a LCK..line file */ /* If if fails, that means that uucico or cu are using the line. */ /* In this case, just do a busy wait, periodically checking */ /* for the LCK..line file. When it goes away, then exit and */ /* a new uugetty will be spawned. */ /* If it succeeds, then this is someone logging in--do normal */ /* getty processing. */ /* NOTE: */ /* When the person hangs up (login case) the LCK..line file */ /* will remain, but this is ok because the ulockf() function */ /* used by uucico and uugetty and cu check the pid in the LCK */ /* file and if it doesn't exist, the LCK file is removed when */ /* it is needed. */ /* Also, uugetty always sets the owner of the line to uucp. */ /* This is so that uucico/cu/tip can get at the line. (cu and tip */ /* must run setuid uucp--or this will not work.) */ /* */ /* There is an additional option for direct lines and lines */ /* that have intelligent modems (ones that return on open */ /* immediately. The -r option means wait for one character */ /* before putting out the login message. If the character */ /* comes in, then check the LCK file and proceed as above. */ --trevc-- Trevor Cotton, MIPS Computer Systems Inc. MS 6-05, 930 DeGuigne Drive, Sunnyvale, CA 94086 Tel: +1 408 524 7286 Fax: +1 408 524 7521 Email: {wyse,ames,decwrl,pyramid}!mips!trevc trevc@mips.com