Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP
Path: utzoo!linus!decvax!mit-athena!mit-eddie!smh
From: smh@mit-eddie.UUCP (Steven M. Haflich)
Newsgroups: net.unix-wizards
Subject: Re: Getting 'getty' to hangup dialup lines.
Message-ID: <2479@mit-eddie.UUCP>
Date: Thu, 2-Aug-84 09:44:23 EDT
Article-I.D.: mit-eddi.2479
Posted: Thu Aug  2 09:44:23 1984
Date-Received: Wed, 8-Aug-84 00:56:13 EDT
References: <297@ipms.UUCP>
Organization: MIT, Cambridge, MA
Lines: 30

[]	I added the line
		ioctl(0,TIOCHPCL,0);
	to getty.c to cause dialup lines to hangup when a user logs out.

	For some unknown reason that does not work all of the time.  Does
	anybody have any idea why?

	We are running bsd4.1 on a vax11/750 and using DF03's for dialup units.

Most 4.? system sources I have examined come with the line
	tp->t_state |= TS_HUPCLS;
commented out (e.g. in dz.c).  Otherwise the kernel would set HUPCLS as
the default state at first open.  Can anyone suggest why it might have
been disabled?  The only effect is that after logout on a dialup line,
one has to redial.  This inconvenience is outweighed by the protection
against having dialups hung by users who forget to "hang up".

Anyway, the likely reason it *sometimes* doesn't work, regardless:  I
have no experience with the DF03, but modems usually low pass filter
transients of state changes.  "Hanging up" consists of dropping DTR to
the modem, but the modem may fail to disconnect if DTR is dropped only
very briefly.  What could be happening is that when the user "shell"
process exits and the tty is closed, invoking HUPCLS and dropping DTR,
init wakes up and reopens the line immediately.  DTR is not unasserted
long enough for the modem to see it and believe it.

This can be fixed by placing a "sleep(2);" in front of the multi-user
tty open in the init process itself.

Steve Haflich