Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!decvax!dartvax!andyb From: andyb@dartvax.UUCP (Andy Behrens) Newsgroups: comp.unix.questions Subject: Re: stty 0 Message-ID: <7783@dartvax.UUCP> Date: 19 Dec 87 01:40:35 GMT References: <2412@homxc.UUCP> Reply-To: andyb@burlcoat.uucp (Andy Behrens) Organization: Dartmouth College, Hanover, NH Lines: 23 Keywords: bye In article <2412@homxc.UUCP> ldm@homxc.UUCP (the wharf rat) writes: > I work on a switching system that doesn't drop the line when I log > off. So I wrote a short one to stty 0: > [program omitted] > and trap 0 "bye" in .profile. Right? Wrong. I still (sometimes!) > get another login: . Of course, stty 0 from the shell works every time... > > What's going on ? Your program is correctly dropping the line. Unfortunately, as soon as it and your shell terminate, the system starts up another copy of getty. What's the first thing that getty does? It resets the line to its normal state. That usually happens fast enough that the switching system doesn't see that the line has dropped. Your program could call sleep() before it exits. You don't need to write any C, though -- just trap 'stty 0;sleep 3' 0. Andy Behrens {astrovax,ihnp4,linus,harvard,decvax}!dartvax!burlcoat!andyb andyb%burlcoat@dartmouth.EDU RFD 1 Box 116, Union Village, Vt. 05043