I have never seen anyone be able to kill a zombie process, and I don't think there is any benefit to it. A zombie process just sits around in a wait state doing nothing. The only method I have ever seen to clear zombie processes is to reboot the server, but again, since zombies don't use up any substantial resources I don't really see the point to making it much of a priority. Maybe someone else has experienced something different, but that is what I have always seen.
Thanks sirs, my question is.. I have such a situation..
when users close their session by clicking the "X" on the terminal, they don't kill all the processes forked by the shell, so I have "zombie" processes using cpu.. I need to recover their PID and kill them.
regards
Hmmm, a true zombie process should have a "Z" listing in when you run a ps. Maybe what you are seeing are orphaned processes that are still using resources since by definition a zombie uses no resources besides a listing in the process table. Can you provide ps output for the processes you think are the zombies?
You can get rid of real zombies (processes which have died, but their parent won't acknowledge that fact: the SIGCLD signal has not been received by the parent)
On AIX5 aixmibd is prone to leave zombies around.
You can find out the parent of the zombie processed from a
# ps -ef|grep defunct
output. If it is aixmibd, get rid of the zombies by stopping and restarting aixmibd:
# stopsrc -s aixmibd
(then wait while srcmstr kills aixmibd - takes longer because now aixmibd first has to acknowledge all it's zombies before terminating itself)
then restart aixmibd
# startsrc -s aixmibd
If the zombies are caused by a different process, sometimes a reboot is the only solution, because you can't go and indiscriminately kill any old process - well you can, but not without adverse effects...
I've dealt with a similar situation, and found that the orphaned processes could be identified by examining lsof output, because they lacked stdout (file descriptor 0).
If you have lsof installed, you can check a known orphan's files with "lsof -p <pid>". If it has no entry with 0u in the FD column, this could be the way for you to identify them. The -c option was used in our case, because the orphans we were getting were all of one particular program.
I'd post the script, but process reaping is best developed on a case by case basis, with plenty of testing.
Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.