tty hangup on session leader exit

Zoltan Hidvegi (
Tue, 10 Oct 1995 22:16:23 +0100 (MET)

Recently Theodore Ts'o posted an experimental patch which causes an implicit
vhangup() on the controlling terminal when the session leader exits. I tried
this patch with Linux-1.2.13. I have a dial-in modem on /dev/ttyS1. It uses
getty_ps with the WAITFOR option: it watches the serial port, and when a RING
message comes, it answers the phone. When it is started, it waits for a
character on /dev/ttyS1. If I start a dial-out program uugetty receives the
first character it sends to /dev/cua1, sees that there is a lock on the
device, so it exits, and gives the terminal to the dialout program.
Unfortunately on exit, the dialout program receives the hangup. This only
happens with the patched kernel. It may be a bug in uugetty, which should not
make /dev/ttyS1 a controlling terminal. I do not know enough about that to
fix it. As far as I know, when a process without a controlling terminal opens
a tty, it automatically becomes its controlling tty. Is there a way to avoid


P.S. I read only the digest, which is quite unrelyable. Please send a Cc of
the answers directly to me. Thanks.