uugetty & lock files

Leslie Mikesell les at chinet.chi.il.us
Sat Sep 8 05:29:47 AEST 1990


In article <384 at fe2o3.UUCP> michael at fe2o3.UUCP (Michael Katzmann) writes:
>I have a Sys V.3 system with HDB uucp. The system is at home and
>it shares the phoneline. So that it won't answer the phone every time,
>I run a programme with cron that tells the modem (hayes 2400) to 
>enable auto answer only at specific times (a window that the machine
>that rings me up knows about).

>This programme looks to see if a lockfile is present
> /usr/spool/locks/LCK..tty1, before blindly writting out to the line.

>The problem:
>	uugetty seems to create a lockfile when a character is first received.
>I dont know when it is removed (perhaps after uugetty is restarted after a 
>login), however if it was just noise and no login is successful the lockfile,
>it seems, is never removed.

First, be sure that your modem is set to pass the state of the carrier
detect line to the computer instead of holding it up all the time.  This
should make uugetty recycle when the line drops.  Note that this will
require you to use O_NDELAY if you want to talk to the modem with your
own program - you won't be able to just echo characters out the port
from a shell script. 

Next, if the modem is set up to observe the state of the computer's DTR
lead, then it won't answer unless uugetty is running.  Thus you can make
a cron entry that alters /etc/inittab and does an "init q" at appropriate
time to control the times the machine will answer.

Alternatively, if you really want to chat with the modem without a whole
lot of work it can be done like this:
  Set up a Devices entry with a previously unused modem-class and dialer
  using the same device as your modem:
ACU tty1,M - S2400 setup
  Set up a matching Dialer script with whatever you want (it doesn't
  need to dial anything)
  Make a Systems entry that requests this modem-class:
setup Any ACU S2400 -

Now you can just "echo ~. |cu setup"  and the specified chat will occur
with all the appropriate checks for the device being in use.
A similar procedure works nicely for actually dialing systems that need
more than the usual dialing script, like dialing up a packet switch and
asking for a connection.  Each physical device can be listed many times
in the "Devices" file with different modem-classes and dialer types.  The
modem-class entry in the System file controls which entry is matched and
thus which dialer chat script will be used to connect to that system.

Les Mikesell
  les at chinet.chi.il.us



More information about the Comp.unix.questions mailing list