Getting 'getty' to hangup dialup lines.

Steven M. Haflich smh at mit-eddie.UUCP
Thu Aug 2 23:44:23 AEST 1984


[]	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



More information about the Comp.unix.wizards mailing list