Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!utah-cs!seismo!hao!hplabs!sri-unix!dbj@RICE.ARPA From: dbj@RICE.ARPA Newsgroups: net.unix-wizards Subject: Re: Getting 'getty' to hangup dialup lines. Message-ID: <12340@sri-arpa.UUCP> Date: Thu, 16-Aug-84 01:04:03 EDT Article-I.D.: sri-arpa.12340 Posted: Thu Aug 16 01:04:03 1984 Date-Received: Tue, 14-Aug-84 19:36:09 EDT Lines: 30 From: Dave JohnsonI added the line ioctl(0,TIOCHPCL,0); to getty.c to cause dialup lines to hangup when a user logs out. For some unknown reason that does not work all of the time. Does anybody have any idea why? The reason that this doesn't work some times is that the device close routine (which is responsible for actually dropping DTR after you've done a TIOCHPCL) does not get called by the kernel until the last file descriptor is closed to that device. If there are processes running in the background on that terminal when you log off, they will most likely still have files open to the terminal, and thus the device close routine does not get called and the line does not get hung up. Alas, vhangup() does not dissassociate the background processes from the terminal enough to convice the rest of the kernel to call the device close routine or to call it itself to get the hang up effect. Currently, the only real way to fix this would be to carefully run background processes with their standard input, output and error redirected somewhere other than the terminal, such as to /dev/null with process &/dev/null & Dave Johnson Dept. of Computer Science Rice University dbj@rice.ARPA