1832592 Members
2800 Online
110043 Solutions
New Discussion

Re: lingo

 
Marc Ahrendt
Super Advisor

lingo

what does zombie, orphan, defunct, and run-away processes mean? and how can each be addressed?
i have seen admins/books say different things for each, and i am at the point where i do not know who is right/wrong
hola
5 REPLIES 5
Sachin Patel
Honored Contributor

Re: lingo

Hi Marc,

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa26e87dc4d7dd5118ff00090279cd0f9,00.html

Sachin
Is photography a hobby or another way to spend $
Michael Tully
Honored Contributor

Re: lingo

This post explains it quite well. Look
for the response(s) by Magdi.


http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa26e87dc4d7dd5118ff00090279cd0f9

-Michael
Anyone for a Mutiny ?
Victor_5
Trusted Contributor
Magdi KAMAL
Respected Contributor

Re: lingo

Hi Marc,

Zombie process are those ones that when they finish working ( normal or abnormal exit ) they didn't find their parents executing a wait() function( waiting ) for them.

That's mean, consider a process P0 is doing a fork ( creates a copy of himeself ). The copy process is P1 called the child process ( so P0 is the parent process of P1 ).

If P1 finish his work ( normal or abnormal exit ) and P0 is not listening to him with a wait() function. So , P1 became a ZOMBIE process.

Alot of devellopers fall into this problem ( they are no more accepted into the system under their loginnames till these zambies are killed with a BOOT of course ) and the only way to kill them is REBOOTING the system.

Why booting, is that Zombies are considered as
1. Not live nor Died !!! So how to kill them.

If you need any help to avoid this miss programming, I have the solution just append your request .


Have a look in the following book :

Advanced Programming in the UNIX Environment.
Addison-Wesley
W. Richard Stevens.
Pages 195 and 196


Example:

P0 is the parent of P1.
P1 is the child of P0.

Normal programming is :
1. The parent P0 should execute a wait() function before a child process terminates normally or abnormally.
2. If Child process is not sure that his parent is waiting for him , he will execute the function getppid() function and executes an exit() as soon the function getppid() returns 1 ( that means that the unix init process (pid 1) is the actual parent).

unix init process ( pid 1) inheriets all orphan processes and immediately executes a wait() function as soon as a child process exits ( normal or abnormal exit ).

It's really the Client/Server model from a process point of view .

The manner by which the Unix model avoid that is :

P0 forks twice ,

P0 fork and gives P1
P1 fork and gives P2

1.The first instruction of P2 is to loop till getppid() returns 1; getppid means GetParentProcessIdentification. ( init process )
2. The first instruction of P1 is exit() function.
3. P2 became ORPHAN.
4. init process become the actual parent of P2.
5. The function getppid() returns 1 now.
6. The P2 process executes its task.
7. P2 terminates normally or abnormally.
8. init process executes an immediate wait() function.
9. P2 died without being ZAMBIE.

If you follow this protocol, your application will never have zombies processes.

Hope this explain the issue.
Wainting for any discussion.


Magdi
Marc Ahrendt
Super Advisor

Re: lingo

thx ...but i read all those before posting my question. i was hoping for some new information.
at this point i think the following
zombies: cannot communicate with parent, cannot be killed (only reboot clears), shows up in "ps" as for COMMAND, and Z for STATE
orphans: cannot communicate with its parent, but if init becomes the parent there is a chance for it to die/exit without turning into a zombie
defunct: zombie
runaway: shows up possibly in "ps" as R for state, is able to be killed, only a CPU hog with high values for TIME in "ps"

wondering if my simplified summary is OK? is missing any basic key concept, etc.?

wondering also if there were some other ways to identify zombies/orphans, to terminate orphans (like using special kill signals), and to possibly get early signs of runaways/potential runaways?

thx in advance for any input, and to those who have already replied

hola