Return to BSD News archive
Xref: sserve comp.unix.bsd:12127 comp.unix.questions:35864 Path: sserve!newshost.anu.edu.au!munnari.oz.au!uunet!psinntp!monymsys!bartal!phillip From: phillip@BARTAL.COM (Phillip M. Vogel) Newsgroups: comp.unix.bsd,comp.unix.questions Subject: How to prevent zombies? Message-ID: <5909@bartal.BARTAL.COM> Date: 26 Jun 93 20:50:47 GMT Followup-To: comp.unix.bsd Organization: Bartal Design Group, Inc. Lines: 66 Hi- I'm porting some software from SVr3 to BSDI's BSD/386, and I've run into a problem with zombie processes piling up. The program waits for an event, forks off a process, and goes back to processing input, waiting for another event. The child process is expected to complete it's job, and then just 'go away'. In system V, you can just do a signal(SIGCLD,SIG_IGN) and this will cause the terminating child processes to not create zombies. I hacked up a really crude solution which simply kills off the oldest child (rather biblical, don't you think) when there are more than 5 children running. This works OK, but there is the possibility that one or more of the children may not really be finished doing it's job. Is there a cleaner way to handle this in bsd? Any help will be greatly appreciated. Thanks, Phillip -- Phillip M. Vogel, Technical Director | Ask about the 'Visual Conductor'(TM) TimeStream Technologies, Inc. | Domain: phillip@bartal.com 318 Marlboro Road, Englewood, NJ 07631 | (201)567-1343 FAX:(201)568-2891 Newsgroups: comp.unix.bsd,comp.unix.questions Subject: How to prevent zombies?? Summary: Expires: References: Sender: Followup-To: Distribution: Organization: Bartal Design Group, Inc. Hi- I'm porting some software from SVr3 to BSDI's BSD/386, and I've run into a problem with zombie processes piling up. The program waits for an event, forks off a process, and goes back to processing input, waiting for another event. The child process is expected to complete it's job, and then just 'go away'. In system V, you can just do a signal(SIGCLD,SIG_IGN) and this will cause the terminating child processes to not create zombies. I hacked up a really crude solution which simply kills off the oldest child (rather biblical, don't you think) when there are more than 5 children running. This works OK, but there is the possibility that one or more of the children may not really be finished doing it's job. Is there a cleaner way to handle this in bsd? Any help will be greatly appreciated. Thanks, Phillip -- Phillip M. Vogel, Technical Director | Ask about the 'Visual Conductor'(TM) TimeStream Technologies, Inc. | Domain: phillip@bartal.com 318 Marlboro Road, Englewood, NJ 07631 | (201)567-1343 FAX:(201)568-2891