Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site watcgl.UUCP
Path: utzoo!watmath!watcgl!dmmartindale
From: dmmartindale@watcgl.UUCP (Dave Martindale)
Newsgroups: net.unix-wizards
Subject: Re: Getting 'getty' to hangup dialup lines.
Message-ID: <2927@watcgl.UUCP>
Date: Tue, 7-Aug-84 02:27:58 EDT
Article-I.D.: watcgl.2927
Posted: Tue Aug  7 02:27:58 1984
Date-Received: Wed, 8-Aug-84 19:00:53 EDT
References: <297@ipms.UUCP>, <2479@mit-eddie.UUCP>
Organization: U of Waterloo, Ontario
Lines: 15

Another reason (the most common one here) that modems don't hang up
when someone logs off is this:

The hangup is done when the last process that has that terminal open
exits, NOT when the user logs off.  If the last-on user left a background
process running without explicitly redirecting stdin, stdout, and stderr,
then the tty is still open, and the hangup doesn't happen.  Or a previous
user who logged on last week may have left a process around - as long as
it's still running, it will prevent the hangup from happening.

Note that vhangup() prevents such background processes from reading from
or writing to the tty, but they still have an open descriptor.
The right way to fix this is to modify vhangup() to eliminate those
pointers to the tty entirely, either in u_ofile or by changing the
entries in the file table, but it isn't simple.