----- Original Message -----
From: "Pong" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 12:22 PM
Subject: Re: [plug] how to kill zombie processes w/o rebooting?


> well a zombie in linux is a process whose process space (code/data)
> are already gone but still has an entry in the process table in kernel.

i would like to further add the definition of a zombie....

in unix terminology, a process that has terminated, but whose *parent* has
not yet *waited* (eg. wait(), waitpid(), wait3() or wait4()), it is called
zombie....

there are five ways for a process to terminate:

for normal termination:

    1. return from main
    2. calling exit
    3. calling _exit

for abnormal termination:

    4. calling abort
    5. terminated by a signal

regardless how a process terminates, the kernel code closes all open
descriptors for the process, release the memory that it was using and the
like except its process table entry is still there until the parent waited
it....

therefore, when a child process terminated and completely disappeared
(except its process table entry) and the parent wouldnt be able to fetch its
termination status (thru any of the wait functions), it is called zombie...


> so killing it (signals) wont work

killing (thru signal) a zombie wont work because it is already terminated as
what i explain above

> but calling wait() will make the
> process entries disappear (no more zombies).

only and only if its own parent waited it...

> the problem lies when the parent process
> doesnt call wait() making the zombies out of them.  so it's 'init' to the
> rescue becuase it will sure call wait() for each dead process under it.
> that's init's job mostly in a running system.

the proper term here is terminated process not a dead process... a dead
process is already considered as zombie....

init process will act as a parent if the parent of a child process
terminates before the child.... init is written so that whenever one of its
children terminates, init calls one of the wait functions to fetch the
termination status....

----- Original Message -----
From: "Pong" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 12:09 PM
Subject: Re: [plug] how to kill zombie processes w/o rebooting?


> under redhat, you can use 'pstree -p' to find the process id
> of the super parent.

ps -Af will do for linux and look for PPID (parent process id) column
besides from PID column....

> the parent processes could be deficient in using wait() calls.
> but init will be happy to do that for us.

only and only if the parent of a child process terminates early before the
child...




----- Original Message -----
From: "Marc Henry Galang" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 1:41 PM
Subject: Re: [plug] how to kill zombie processes w/o rebooting?



> Usually zombie process are
> harmless, unless when it is messing up with other process.

zombie process is a terminated process therefore it wont messing up with
other process...

i would say zombie is harmful... even though it is a terminated process, it
still occupy space (process table entry).... the more zombie you have the
more space allocated....take note that a process table entry is a link list
structure.... searching a process in a process table will take more time
compare without a zombie entry....



----- Original Message -----
From: "Ariz Jacinto" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 11:53 AM
Subject: Re: [plug] how to kill zombie processes w/o rebooting?


> but the problem is that the file was locked by the process
> thus the file can't be submitted to the client.
> and we cant even reboot the machine coz it will halt
> the production and cause more delays.

ariz, i doubt that the file was locked by a zombie... as i explain above,
zombie is a terminated process and it closes all open descriptors...
therefore the lock was released...

i dont know what process is this causing you a zombie but even there is a
locked file, you can still use the *cp* (copy) command to copy the file...


here are two simple steps to kill a zombie...

1. if the parent is still alive, try to kill it (or SIGHUP is all you need)
2. if number 1 fails, there is a bug in the kernel.... reboot is your friend
and fix that bug :->

fooler.







--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to