Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.unix.questions Subject: Re: Proper exit handling Message-ID: <9934@smoke.BRL.MIL> Date: 27 Mar 89 14:23:04 GMT References: <18832@adm.BRL.MIL> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <18832@adm.BRL.MIL> Kemp@DOCKMASTER.NCSC.MIL writes: > Does anyone know of a bulletproof method of installing an exit >handling routine that is guaranteed to be called when a process >terminates? Try running the "real" process as the child of another "monitor" process. The monitor would, of course, save the initial terminal state, fork/exec the child, wait for the child to terminate, then reset the terminal state and finally report the child exit status.