Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ecsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!mcnc!ecsvax!bet From: bet@ecsvax.UUCP (Bennett E. Todd III) Newsgroups: net.unix-wizards Subject: Re: Timed self-destruct (for debugging programs that hang) Message-ID: <1031@ecsvax.UUCP> Date: Tue, 7-Jan-86 11:57:40 EST Article-I.D.: ecsvax.1031 Posted: Tue Jan 7 11:57:40 1986 Date-Received: Thu, 9-Jan-86 03:02:36 EST References: <952@ecsvax.UUCP> Reply-To: bet@ecsvax.UUCP (Bennett E. Todd III) Distribution: net Organization: Duke University Computation Center Lines: 29 Well, I got a few helpful responses. I appreciate everyone's forbearance with such ugly code. I got suggestions for good tricks to play with adb, for ways to refine the program I wrote, and other such tips. However, the real kicker comes from: Stephen Samuel {ihnp4,ubc-visi}!alberta!uofa-mts!stephen_samuel who gets the prize for cleverest hack of the bunch: ( sleep 120 ; kill -9 $$ ) & exec $* His explanation is succinct: "What it does is have the kill delete the primary process, which is then replaced with the real intended program. Note that this also results in a mimimum of extra procsses and NO temporary files." Hat's off. I guess this illustrates the basic nature of UNIX; there is generally only one correct way to do a thing, and many many wrong ways, most of which will occur to you before the right one. -Bennett -- Bennett Todd -- Duke Computation Center, Durham, NC 27706-7756; (919) 684-3695 UUCP: ...{decvax,seismo,philabs,ihnp4,akgua}!mcnc!ecsvax!duccpc!bet