Getting 'getty' to hangup dialup lines.

Dave Martindale dmmartindale at watcgl.UUCP
Tue Aug 7 16:27:58 AEST 1984


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.



More information about the Comp.unix.wizards mailing list