un-dedicating a line to a dialer

Bob Toxen bob at onyx.UUCP
Thu Dec 22 09:12:12 AEST 1983


We solved the getty/uucico problem by hacking  getty  to  respect
uucico's  /usr/spool/uucp/LCK..ttyxx  and  when  it  successfully
grabbed  the   lock   to   create   one   of   its   own   called
/usr/spool/uucp/LCK.g2.ttyxx  which  means:  "I have the line but
I'm just waiting for someone to  login  [our  tty  driver/  modem
combo  have  the problem that the modem will only assert RTS when
someone calls in but not when you want to call out]  but  if  you
send  me  a  SIGTERM  or  SIGHUP  I'll close the file, 'chmod 666
/dev/ttyxx', and remove the locks (LCK.g2.ttyxx first) and wait a
minute  before  again trying to grab LCK..ttyxx". Be sure to also
do this before getty exits in any fashion.

When getty is about to exec login it first  creates  LCK.g3.ttyxx
and  then unlinks LCK.g2.ttyxx. The LCK.g3.ttyxx is so that after
the person logs out the next getty will, before  trying  to  grab
LCK..ttyxx,  try  to  unlink  LCK.g3.ttyxx  and if it can it will
assume that the previous getty left this and  also  a  LCK..ttyxx
which this getty will then unlink.

UUCICO will, if LCK..ttyxx exists, check  for  the  existance  of
LCK.g2.ttyxx  BEFORE  CHECKING  THE  AGE  OF LCK..ttyxx and if it
exists then send a signal to the getty (whose binary  PID  is  in
LCK.g2.ttyxx)  via  an  intermediate  program with mode 4110 with
owner root and group uucp. This requires uucico to be  both  Set-
UID AND Set-GID to uucp.

This is more complex than I like but only takes about 30 lines of
code in each of getty and uucico (sorry, I can't supply code) and
doesn't require Kernel hacking or any intelligence in the port or
modem.

Bob Toxen  ucbvax!amd70!onyx!bob



More information about the Comp.unix.wizards mailing list