How to kill Zombie process?

张少驰 zhangsc at neusoft.com
Mon Dec 17 03:34:35 CET 2001


  When I use ret=os.fork(),it will create a parent process and child process,when child process exists,it will creaet a Zombie process,How to kill it in parent's process? For example:

udpSerSock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
while 1:
  message=recvfrom(BUFSIZ)
  ret=os.fork()
  if ret==0:
     udpSerSock.close()
     ip=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
     #something deal
     ....
     ip.close() 
     break

#ps -a
I will find a Zombie process  
5463 pts/3    00:00:01 python
5465 pts/3    00:00:00 python <defunct>  #Zombie process

How to kill it? Any ideas will be appreciated,Thanks!
                  Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20011217/22eb2ac4/attachment.html>


More information about the Python-list mailing list