dawdy@mnss.UUCP ( Jay Dawdy) (03/14/90)
Situation: In /etc/inittab, have uugetty on port with respawn and -r -t60 options. This needs to be so. I want to dial out on port with a terminal emulation program. In pgm, I open lockfile with O_CREAT, O_EXCL, and O_WRONLY, write to it, close it, and reopen it. After sending init and dial strings to modem, uugetty intercepts 'cr' from modem and starts login on port. Problem: How do I keep uugetty from starting login? It seems to me that if cu can do this, than I should be able to also. Thanks in advance, Me 708-576-6698
les@chinet.chi.il.us (Leslie Mikesell) (03/15/90)
In article <103@mnss.UUCP> dawdy@mnss.UUCP ( Jay Dawdy) writes: >Situation: In /etc/inittab, have uugetty on port with respawn and -r -t60 >options. This needs to be so. I want to dial out on port with a terminal >emulation program. In pgm, I open lockfile with O_CREAT, O_EXCL, and O_WRONLY, >write to it, close it, and reopen it. After sending init and dial strings to >modem, uugetty intercepts 'cr' from modem and starts login on port. >Problem: How do I keep uugetty from starting login? The lockfile is expected to contain the PID of the process using the port in a particular format ("%10d\n" should work, but look at one created by cu to be sure). Be sure that the permissions on the file allow uucp to read it. Programs are supposed to be able to check for the existance of the program that wrote the lockfile using kill(pid,0) to detect when a program exits without releasing its lock. Note that using open(...O_CREAT), write(), leaves a window where the filename exists but does not have the correct contents. It would be better to write the file under a tmp name, then link() to the LCK..ttynn name. This is for AT&T unix - there are other variations on this theme. Les Mikesell les@chinet.chi.il