Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: How to clean out Zombies? Message-ID: <1990Jul21.031957.7141@virtech.uucp> Date: 21 Jul 90 03:19:57 GMT References: <24986.26a58a7a@kuhub.cc.ukans.edu> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 22 In article <24986.26a58a7a@kuhub.cc.ukans.edu> jian@kuhub.cc.ukans.edu writes: > I am writting a program that works like a daemon process. The master >will run forever on UNIX and listen a port for request calls. In order to >make the master process be able to handle multiple calls at the same time, >I design the program to spawn out child process to perform work whenever a >request call comes. The child process will terminate itself when a clear >call signal is received. Here is the problem. When I use "ps ux" shell >command to check the status of processes on the system, I found lots of >Zombie processes. If I terminate the master process, all of zombies are gone. Read the Wait*(2) and Signal(2) manual pages for your system. I can't tell you exactly what to do since you didnot mention what OS you are running. Essentially what you need to do is call wait() as some point which will clean up the zombies. You can set up your daemon to get a signal whenever a child exits and you can then do the wait() which won't block. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170