![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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! |
|
#5
|
||||
|
||||
|
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. |
|
#6
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |