From: utzoo!decvax!cca!ima!johnl
Newsgroups: net.unix-wizards
Title: Re: UUCP and line turn around
Article-I.D.: ima.187
Posted: Fri Aug 13 10:50:39 1982
Received: Tue Aug 17 07:08:20 1982
References: n44a.111

Dan Ts'o's method of turning around a line for use as both dial in and
dial out strikes me as being somewhat overimplemented.  Here's how I
accomplished it with less work:

    1.  You have programs "enable" and "disable" that edit /etc/ttys
	and poke the init process.  They have been on Usenix tapes before
	and are easy to write in any event.

    2.  Modify /etc/getty so that it deletes /usr/spool/uucp/LCK..ttyX
        whenever it starts up on line X (because the line is now free.)
        Have it create that file when a user starts to log in, e.g. when
        it gets the first character of the login name.  You might have a
        file that identifies lines that are subject to turn-around, to
	avoid useless lock files.  If your version of /etc/init opens the
	tty before calling getty, you'll have to delete the lock file in
	init.

    3.  Modify uucp (and cu if you use it) so that when it creates the
	lock file it looks in /etc/ttys, and if the line is enabled, it
	disables it.  Similarly, when it deletes the lock file, it should
	re-enable the line if it previously disabled it.

That's all you need to do.  Works fine for me.  Dan's method avoided
changing uucp, but involved changes to the kernel.  This method keeps it
all in user mode.