The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
zombie process jeenat Linux 5 03-28-2008 04:36 AM
Daemon...Zombie?? Please help me Kacyndra High Level Programming 3 05-10-2005 06:40 AM
Zombie process swhitney UNIX for Advanced & Expert Users 2 10-22-2004 02:12 PM
zombie program merlin UNIX for Dummies Questions & Answers 8 11-14-2002 08:31 AM
Zombie process orca UNIX for Dummies Questions & Answers 8 04-26-2002 11:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-20-2001
Registered User
 

Join Date: Sep 2001
Location: Johnston, Iowa
Posts: 7
Question Zombie Files on a HP-UX

How can you find a zombie file on the system. I have been in the database side of the system to search for Orphan files removed the orphan files, but still got the zombie file. When you run a top command it says there is a zombie process that is running i would like to find it. How can i do that?

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 12-20-2001
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
A zombie process is created when a parent process dies without cleaning up its children properly. AFAIK there is nothing you can do to clean them up after the fact except reboot. They generally dont cause any harm though. If you are seeing many zombies you should investigate which program is causing them and fix the problem.
Reply With Quote
  #3  
Old 12-20-2001
Registered User
 

Join Date: Sep 2001
Location: Johnston, Iowa
Posts: 7
Thank you that is what i thought but was not too sure and i am not going to kill it since it is my complete database that caused this zombie process.

Thanks
Reply With Quote
  #4  
Old 12-20-2001
Registered User
 

Join Date: Dec 2001
Posts: 6
About zombie processes, I have several opinion.

1) The cause lead to generation of zombie is, when the child processes stop (as you know, a signal of SIGCHLD will be sent to the father process), normally the father should do something with the signal SIGCHLD with the system call wait() or waitpid(). But if the father process encounters a logical error in his internal procedure. certainly the signal SIGCHLD is blocked. so the father can not release the resource occupied by his child processes. you can run 'ps -ef|grep defunct' to search all the zombies.

2) To solve this problem. you can kill the father process of all the dufunct processes. the initial process 'init' will release all the zombies automaticlly.

Another thing, I am from China. So my english language may be not good enough to interpret all your doubtness! Thank you!
__________________
Maybe another e-mail address: wb_yang@chinaren.com is more convenient than the above one. welcome!
Reply With Quote
  #5  
Old 12-21-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
I basicly agree with WayneYang. Every time you see a zombie on ps, look at the ppid field to find the parent program that is ignoring the death of its children. That program really has a bug and it should be fixed. And if you kill that parent, init will inherit the zombies and reap them.

But there is nothing wrong with ignoring SIGCHLD. Lots of well behaved programs simply issue the wait() call at the proper time.
Reply With Quote
  #6  
Old 01-15-2002
Registered User
 

Join Date: Nov 2001
Posts: 1
try this:

while ((ret = waitpid((pid_t)-1, &status, WNOHANG)) != 0) {
printf("ret : %d", ret);
}

put this in your main loop and it will remove all defunct processes.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0