[comp.unix.questions] how do i drop connection on hang up

PAAAAAR%CALSTATE.BITNET@wiscvm.wisc.EDU (04/17/87)

Carles Shub <cdash@boulder.colorado.edu> writes

>we have microvaxen...hp-9000s...the system comes back with a login.


We have this problem on a diddy PDP11 running BSD2.9 (optimized BSD4.2)
connected to a multiplexer (MUX). We have a kludge/hack for Hayestype modems.

There are two signals on a RS232 to hangup a line - BREAK and "DTRdrop". Normal
terminals send both.

Manual entries for ioctl, tty and stty give several ways for UNIX programs to
send a BREAK signal and/or "hang up a line".

HOWEVER: None of these work because our multiplexer(MUX) only transmits the
BREAK signals but the port selector/terminal server(a MICOM) requires a "DTR
drop" to disconnect a computer - even tho' it will accept a BREAK from a
terminal.

Thus a VT100 can send a BREAK+DTRdrop to the MUX. The MUX transmits the BREAK
only. The port selector passes it thru to a computer. If it is a nearby machine
with no MUX it drops the DTR line with or without a *long* break. This makes
the portselector disconnect the terminal from the terminal. BUT when there is a
MUX between PDP and MICOM the DTRdrop never arrives.

This problem becomes intolerable when someone uses a modem or a MUX to make the
connection. Modems can lose BREAK and/or hangup on DTRdrop. One connection
stayed alive for 48hours with the PDP powered down last weekend!

Since the multiplexed wire is between buildings we are stuck with it.

A different weirdo stopped us hanging up the modem on the system. But here is
my kludge/hack for hanging up Hayes compatable modems.

Add a shell script /etc/hangup:
-----
echo 'Hanging up!';sleep 10;echo '+++';sleep 10; echo ATH;echo ATH;stty 0
-----

Note - the 'sleep' statements and duplicated ATH commands are needed for our
modems. This will switch most modems to command state and ask'em to hang up.

Add a user 'bye' with no password and /etc/hangup as a shell. When a user is
fed up with "login:" they respond - 'bye' and the modem hangs up.


Is there a wizardly solution out there?


Dick Botting, Comp Sci, CSU San Bernardino.
paaaaar@ccs.csuscc.edu
paaaaar@calstate.bitnet
714-887-7365(modem) login as 'guest'
714-887-7368(voice)