From: lidl@sura.net (Kurt J. Lidl)
Subject: Re: uugetty in BSD?
Organization: SURAnet -- 8400 Baltimore Blvd, College Park, MD 20740
Date: Thu, 16 Apr 1992 15:49:54 GMT

ziegast@godzilla.UU.NET (Eric W. Ziegast) writes:
>thomasm@Ingres.COM writes:
>|> Has anyone come up with anything that resembles the AT&T uugetty for BSD?
>|> I've picked up the enable/disable [port] source from the comp.sources.unix
>|> archives and this is very useful but still not quite as good as uugetty -
>|> which respects the uucp locking convention (LCK..com1).
>
>How about looking in the Taylor (GNU) UUCP code?

Well, looking in the 1.03 release of the Taylor-UUCP code, one finds the
following programs:

	uucico uuxqt uux uucp uuchk uustat uuname uulog

No uugetty.

As we all know, uugetty does allows bi-directional in/out calls on the
same serial lines, which are typically used to connect to modems.

SunOS supports something like this, but they do it at the device driver
level.  Basically, you have a regular device, like /dev/ttya, with
the (major,minor) numbers of 12,0.  If you create a device with numbers
12,128 you can attach a service to that device, and it will sleep when
the "normal" device is accessed.

To wit, I have /dev/cua0 (12,0) that I run my UUCP outgoing things on.
I have /dev/ttyd0 (12,128), that I run a getty on.  When the UUCP jobs
are active, my getty just sleeps.  When the UUCP jobs aren't on the line,
the getty is available for use.

I like Sun's approach pretty well -- it removes the complexity from things
like uugetty -- use just regular old getty.   However, it does mean that
you tty drivers have to be a little smarter...  I think that a solution
similar to Sun's would be the *right thing* for 386BSD.  I'd even be
willing to work on it, but 386BSD will not boot on my \#*&^ 386+387 machine.

BTW -- there used to be something similar in the 4.3BSD UUCP code.  Haveing
looked at the code, I think that I can safely say that it probably wouldn't
be really portable off of anything but a VAX.

								-Kurt

/*  acucntrl - turn around tty line between dialin and dialout
 *
 * Usage:       acucntrl {enable,disable} /dev/ttydX
 *
 * History:
 *      First written by Allan Wilkes (fisher!allan)
 *
 *      Modified June 8,1983 by W.Sebok (astrovax!wls) to poke kernel rather
 *      than use kernel hack to turn on/off modem control, using subroutine
 *      stolen from program written by Tsutomu Shimomura
 *      {astrovax,escher}!tsutomu
 *
 *      Worked over many times by W.Sebok (i.e. hacked to death)
 *
 * Operation:
 *   disable (i.e. setup for dialing out)
 *      (1) check input arguments
 *      (2) look in /etc/utmp to check that the line is not in use by another
 *      (3) disable modem control on terminal
 *      (4) check for carrier on device
 *      (5) change owner of device to real id
 *      (6) edit /etc/ttys,  changing the first character of the appropriate
 *          line to 0
 *      (7) send a hangup to process 1 to poke init to disable getty
 *      (8) post uid name in capitals in /etc/utmp to let world know device has
 *          been grabbed
 *      (9) make sure that DTR is on
 *
 *   enable (i.e.) restore for dialin
 *      (1) check input arguments
 *      (2) look in /etc/utmp to check that the line is not in use by another
 *      (3) make sure modem control on terminal is disabled
 *      (4) turn off DTR to make sure line is hung up
 *      (5) condition line: clear exclusive use and set hangup on close modes
 *      (6) turn on modem control
 *      (7) edit /etc/ttys,  changing the first character of the appropriate
 *          line to 1
 *      (8) send a hangup to process 1 to poke init to enable getty
 *      (9) clear uid name for /etc/utmp
 */

-- 
/* Kurt J. Lidl (lidl@sura.net)       | Unix is the answer, but only if you */
/* X.500: Power Tools for Power Fools | phrase the question very carefully. */