Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ncar!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Can I disown a child? Message-ID: <15685@smoke.brl.mil> Date: 3 Apr 91 00:29:52 GMT References: <1991Apr1.190700.2833@ultra.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <1991Apr1.190700.2833@ultra.com> shj@ultra.com (Steve Jay) writes: >I want to fork a process & not have to worry about reaping it. How >can I prevent the child from becoming a zombie when it quits? The classical solution is to fork twice, with the intermediate parent immediately terminating, so that the "grandchild" has no parent and the "grandparent" continues about its business. When an orphaned child terminates, it is assigned PID #1 as its surrogate parent. PID #1 is the "init" process that always exists and fairly soon will wait() for a child, thus finally laying the deceased orphan to rest. >I don't normally read this newsgroup, so please email responses directly >to me. Too bad, if you ask it here you should look here for the answer.