Suppressing uugetty on port while dialing out

Leslie Mikesell les at chinet.chi.il.us
Thu Mar 15 15:46:08 AEST 1990


In article <103 at mnss.UUCP> dawdy at 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 at chinet.chi.il



More information about the Comp.unix.wizards mailing list