[comp.sys.sun] stty [-]nohang?

dberg@cod.nosc.mil (David I. Berg) (04/04/89)

I'm a new SUN user and just brought up a 3/60 with Version 4.0.  To my
surprise, the stty option [-]nohang was conspicuous by its absence.  This
is the function that kills the control process if the remote carrier is
dropped, thus logging out the faulted user and clearing the remote port.
An inquiry to some folks locally informed me that this option was present
in Version 3.  Can anyone point me to a way of ressurecting [-]nohang or
achieving the same result another way?

Thanks in advance.

-- 
David I. Berg (dberg@nosc.mil)
GENISYS Information Systems, Inc., 4250 Pacific Hwy #118, San Diego, CA 92110
MILNET: dberg@nosc.mil
UUCP:   {akgua decvax dcdwest ucbvax}!sdcsvax!noscvax!dberg

[[ Try looking at the "hupcl" option of stty.  I believe you want
"stty hupcl", but I've never verified that it actually works as
advertised.  --wnl ]]

beirne@richsun.reuter.com (Michael G. Beirne) (04/25/89)

In article <1455@cod.NOSC.MIL> you write:
>X-Sun-Spots-Digest: Volume 7, Issue 221, message 9 of 12
>
>I'm a new SUN user and just brought up a 3/60 with Version 4.0.  To my
>surprise, the stty option [-]nohang was conspicuous by its absence.  This
>-- 
>David I. Berg (dberg@nosc.mil)

>[[ Try looking at the "hupcl" option of stty.  I believe you want
>"stty hupcl", but I've never verified that it actually works as
  ^^^^^^^^^^

This is wrong.  hupcl means "hang up on close" or "hang up modem(drop DTR
line) on close of terminal controlling process. The correct way is to stty
-clocal which means assume a line with modem control(Carrier detect).
What this should do when the carrier drops from the modem is send a
HANGUP(HUP) signal to the terminal controlling process which should log
the person off.  This prevents the security problem of the next person
calling in, getting the previous person's session.  It also permits some
recovery if the current session locks up.  The old process gets killed off
when you hangup and you can call up and try it again.

Under system V the best place to set this is in the gettydefs. That way
you set up the inittab to use one entry for modems, that has modem control
enabled and another for terminals that has it disabled. This should allow
you to use 3 wire connections(2,3,and 7) for terminals and 9 wire
connections(1,2,3,4,5,6,7,8, and 20) for modems.

This is not an option to getty for SunOS 4.0.1 or for SunOS 3.5 for that
matter.  It seems to be in the tty device driver itself.  I know that
for the modems to work correctly here, I had to change the flags line
of the device mcp to:
device		mcp0 at vme32d32 ? csr 0x01000000 flags 0x1fff0 priority 4
This change allows the first four ports to be for modems.     ^
The default is for terminal lines on all the ALM ports. Then we relinked and
installed the new vmunix.

Michael G. Beirne
beirne@richp1.UUCP,beirne@richsun.reuter.COM or beirne@limerick.chi.il.us