Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Autologout of unused terminals Message-ID: <586@auspex.UUCP> Date: 5 Dec 88 21:09:59 GMT References: <2113@vedge.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 55 >It does have a problem, perhaps someone can elaborate on, it logs the >user off, but keeps the carrier on, so the line is useless anyways. >Is there some way to force the carrier to be dropped on a KILL -HUP? > >(sun 3, ALM, port configured for modem, DTR dropping will hang up, but >kill -HUP doesn't seem to do it). At least under SunOS 4.0 (and quite possibly under earlier releases), the default behavior is supposed to be that carrier is dropped when the last process that has the terminal open closes it. It may be that: 1) the line is configured for this not to happen (see the "hc" option in GETTYTAB(5)); 2) the "hangup on last close" flag isn't getting set for some other reason; 3) the ALM driver doesn't handle this flag correctly; 4) "kill -HUP" isn't killing off *all* the processes on that terminal, so one of them is still holding the line open. Presumably, you've checked this (some process might ignore SIGHUP, or catch it and either not exit at all or take a long time to exit). If you're running 4.0, the "hangup on last close" flag is accessible to "stty"; try dialing in (so you don't screw some unlucky user while testing) and then do stty -a >(the terminal) and see if "hupcl" (the "hangup on last close" flag) is set or not. If it says "-hupcl", it's not set. Try doing stty hupcl >(the terminal) and then provoke your script into blasting you off and see what happens. If you're running a release before 4.0, the flag can be set, but it cannot be cleared nor can its state be found easily. Try running this small program with its output redirected to the terminal in question: #includemain() { if (ioctl(1, TIOCHPCL, 0) < 0) perror("TIOCHPCL"); } and then run the script (or some version modified to just go ahead and blast just you, but to do so immediately) and see what happens.