1829163 Members
2625 Online
109986 Solutions
New Discussion

Re: kill ZOMBI PROCESS

 
YOGI_3
Frequent Advisor

kill ZOMBI PROCESS

how to kill zombi process ...in top its shwoing
PID ...wen i am tring to kill -9 PID,
its giving error that this process doenot exists..
i want to kill this process
There is never a wrong time to do the right things
14 REPLIES 14
Victor BERRIDGE
Honored Contributor

Re: kill ZOMBI PROCESS

Bad luck...
By definition a real zombie cannot be killed...
Your only way of getting rid of it is reboot



All the best
Victor
Pete Randall
Outstanding Contributor

Re: kill ZOMBI PROCESS

The only other way is to kill the parent. However, quite often the parent ends up being init and you don't want to kill that. Best way is to reboot.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: kill ZOMBI PROCESS

Hi:

First, the classic quote: "You can't kill a zombie. It's already dead!".

If you do a 'kill ' and the error returned is that it doesn't exist then you choose the WRONG process (or the process finally died and was removed from the process table BEFORE you could touch it.

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: kill ZOMBI PROCESS

Hi Yogi,

I can imagine you want, but you CAN'T kill him. He's already dead.

See e.g. this link for a explanation:

http://www.losurs.org/docs/zombies

(just one out of thousands ...)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Geoff Wild
Honored Contributor

Re: kill ZOMBI PROCESS

On HP-UX, most Zombies will disappear - eventually...

Checking:

ps -el |grep Z

You may be able to kill by killing parent - unless as others say parent is 1.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
HGN
Honored Contributor

Re: kill ZOMBI PROCESS

Hi

There is no way other than rebooting the server because you cannot kill a zombie process.

Rgds

HGN
Sandman!
Honored Contributor

Re: kill ZOMBI PROCESS

If you can't eliminate the zombies with "kill -9" then reboot the server. Sorry no other way out.

regards!
Ranjith_5
Honored Contributor

Re: kill ZOMBI PROCESS

No Yogi..You will need a reboot. If this is happening frequently for the same application, may be it is due to that application code error.

Regards,
Syam
Cheryl Griffin
Honored Contributor

Re: kill ZOMBI PROCESS

Interex had a program called 'kill zomb'. Anyone have experience with that? The download site is no longer available, so reboot is the only way to go.

***
On a sidenote, anyone who saw Shaun of the Dead knows the way to kill a zombie is to hit them in the head.
"Downtime is a Crime."
Micky_1
Advisor

Re: kill ZOMBI PROCESS

huh? amazing stories....

maybe we should start with what zombies are...
ok, you have a process, the so called parent...this forks a new process, the so called child!
when the child exits, the parent receives a signal, the sigchld. Now we have a zombie. The livetime of a zombie depends on the parent-programm (or better the programmer). Per definition, the parent has to catch the signal (so called signal-handler) and do a "wait". This is *NOT* the standard-behaviour in all the languages, that I know.
So a good guy will install a signalhandler for SIGCHLD in his programm and just call wait...then your zombies lifetime just depend on the load of the system. In normal cases, you won't even see the zombies...
If you see zombies, you can be sure, that the guy, who programmed the zombies parentprocess has forgotten to think about the signalhandler.
If you kill the parent, the zombie will become a child of the init-process. There you can be sure, that the guys who programmed init were smart enough to think of the signalhandler. If not, you will end up with millions of zombies, because every childprocess, that exits is first a zombie!

So just kill the parentprocess and wait some minutes. You won't have to boot!
And blame the guy who forgots about signalhandlers...

Micky
Raj D.
Honored Contributor

Re: kill ZOMBI PROCESS

Hi ,

When the process goes as Zombi , its control goes to the parent process, and usually init becomes its parent process. And as you cant kill init process, the only option left you need to reboot the box.


Cheers ,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Mark Ellzey
Valued Contributor

Re: kill ZOMBI PROCESS

Yogi,

As everyone has explained, these processes are usually the result of bad programming. The good news is that zombie process consume no memory or CPU time. They are just what they say they are: Zombies!

As A. Clay Stephenson has patiently explained many times, zombies are just entries in the process table, and frequently result from their parent process being killed before the child was killed. As a result, the parent becomes init, and the zombie lives on in the process table. Not memory or CPU.

Regards,
Mark
Micky_1
Advisor

Re: kill ZOMBI PROCESS

ok...now some sample-code

compile it, using "make zombie" (if you have a compiler like gcc on your system)

you won't be able to create a zombie, that lives longer than just a few seconds...I've tried everything to do so! Even killing the parent with "kill -9" won't let the zombie live.
A zombie lives as long, as the system is under very heavy load, or as long as the parent didn't call "wait".

Micky

Ross Minkov
Esteemed Contributor

Re: kill ZOMBI PROCESS

Yogi,

Zombie process is a process which has been killed or exited using exit(2) system call but has not received a wait(2) call from its parent process. It does not consume any system resources except for its entry in the process table maintained by the operating system and can be safely ignored. It will be terminated when its parent process completes execution or during system reboot.

-Ross