Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to locate and kill a zombie

SOLVED
Go to solution
John Jimenez
Super Advisor

Best way to locate and kill a zombie

While running top, there is one zombie running. What is the best way to locate this "PID", so I can kill it?
Hustle Makes things happen
15 REPLIES
Ralph Grothe
Honored Contributor
Solution

Re: Best way to locate and kill a zombie

I'm afraid, I think you won't be able to kill, because the Zombie is waiting for its parent process to fetch its exit code through a wait() or waitpid() syscall by the parent.

However, you can get the PID from the process table if you grep for the string "defunct"

e.g.

ps -ef|grep defu
Madness, thy name is system administration
Sridhar Bhaskarla
Honored Contributor

Re: Best way to locate and kill a zombie

Do a "ps -ef|grep defunct".

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Patrick Wallek
Honored Contributor

Re: Best way to locate and kill a zombie

top shows the PIDs of processes. The 3rd column of the top output is the PID. However, it the process truly is a zombie, then you probably won't be able to kill it. Why? BECAUSE IT'S ALREADY DEAD!!!! To quote from an HP Performance expert.
Helen French
Honored Contributor

Re: Best way to locate and kill a zombie

You can find out the PID from top itself or from grep' ing with 'defunct. But you cannot kill those processes since it's already dead. The best way to get rid of those processes is to reboot the system!
Life is a promise, fulfill it!
John Jimenez
Super Advisor

Re: Best way to locate and kill a zombie

Thanks, I greped "defun" and it found it.
# ps -ef | grep defu
root 3047 2718 3 Feb 15 ? 0:00
root 9189 969 0 09:39:11 ttyvb 0:00 grep defu

It has actually been a long time since I have seen a zombie. As I remember I thought that I can just kill this "PID"? if not how would I get rid of it?
Hustle Makes things happen
John Jimenez
Super Advisor

Re: Best way to locate and kill a zombie

Okay, I will not worry about it, I will just let the reboot take care of it. thanks a lot....
Hustle Makes things happen

Re: Best way to locate and kill a zombie

Sorry to dissappoint you, but he only way to get rid of a zombie process is to rebot.
You cannot kill what is already dead.
In the words of John Cleese, from hte pqrrot sketch in Monty Python:
It is an ex-parrot, it has ceased to be, it is no more.
It's DEAD
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Helen French
Honored Contributor

Re: Best way to locate and kill a zombie

Read this for more information about defunct processes TKB #S1100000464:

http://support2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063236571
Life is a promise, fulfill it!
Pete Randall
Outstanding Contributor

Re: Best way to locate and kill a zombie

John,

What is the parent process? Do a "ps -ef |grep 2718". I would have expected a zombie to be owned by init (PID 1).

Pete

Pete
Sridhar Bhaskarla
Honored Contributor

Re: Best way to locate and kill a zombie

Hi John,

It is still not a real zombie as it's parent it not yet "1", init - the God mother of all processes.

Now try "ps -ef|grep 2718" and see what process is listed?.

A zombie that is attached to init, cannot be killed. They are ghosts waiting to send their status information to their parents that do not exist. So, a good programmer can write a code that will get the status from the waiting child. Once the status is reported, the child will literally die.

If the zombies are not talking too much of CPU (sometimes users report that the defunct process is consuming too much CPU, by misunderstanding how Glance reports), then I will wait for my next maintenance window.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John Jimenez
Super Advisor

Re: Best way to locate and kill a zombie

# ps -ef |grep 2718
root 2718 1 0 Feb 15 ? 0:00 /opt/perf/bin/perflbd
root 3047 2718 3 Feb 15 ? 0:00
root 2733 2718 0 Feb 15 ? 0:57 /opt/perf/bin/rep_server -t SCOo
root 10180 969 2 09:54:37 ttyvb 0:00 grep 2718

Yes it looks like the parent is "1". it does taking any proccessing, but if I have time I will try and find a script, just in case one pops up in the future that does take up processing time. thanks again....
Hustle Makes things happen
Pete Randall
Outstanding Contributor

Re: Best way to locate and kill a zombie

John,

The point is that if the parent is not init (PID 1), the "zombie" can be killed by killing off the parent (in your case 2718). I'm not sure what perfldb is and therefore, I'm not sure this is something you want to do, but it's something to remember for next time.

Pete

Pete
Sridhar Bhaskarla
Honored Contributor

Re: Best way to locate and kill a zombie

If you can afford to stop Measureware on your system, do a mwa stop and see what happens by running ps -ef. That should stop perflbd process. You can do a mwa start later to start that process.

This may probably make it a real zombie. If you are lucky, then it may kill it too.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marco Santerre
Honored Contributor

Re: Best way to locate and kill a zombie

perflbd is part of your MeasureWare software. So to try and kill you rdefunct process I would suggest to try and stop MeasureWare and restart it. That way the paretn process will stop and hopefully terminate its child too.

/sbin/init.d/mwa stop
/sbin/init.d/mwa start
Cooperation is doing with a smile what you have to do anyhow.
John Jimenez
Super Advisor

Re: Best way to locate and kill a zombie

Yes I figured where this came from a few minutes ago. I installed the diagnostic tools over the weekend and had some problems because I did not stop measureware while doing swinstall the first time.

Awesome stopping and starting measureware again did the trick, the zombie disapeared... :)
Hustle Makes things happen