1755083 Members
4127 Online
108829 Solutions
New Discussion юеВ

Sombie Process

 
SOLVED
Go to solution
Jose Luis
Advisor

Sombie Process

Hello everybody:
(HP-UX 11.0)
I have a zombie process and I try kill it with kill -9, kill -2, etc. but those proccess don?t die. Probably being held open by a tcp connection, i'm afraid. I use lsof to see which IP it is:

lsof -i | grep 10257

How can I use the ndd command to close the tcp connection?
Thanks in advance!
PD: Sorry for my poor English

The UNIX world is the tenth planet in the solar system
8 REPLIES 8
John Poff
Honored Contributor

Re: Sombie Process

Hello,

What is the parent process of the zombie?

The 'ndd' command is for viewing and setting network tuneable parameters. It won't help you terminate a TCP connection. Have you been able to do a 'netstat -a' command and see the state of the connection? Maybe it will timeout after while.

Your English is fine!

JP
Abel Berger
Regular Advisor

Re: Sombie Process

Hi Jose,

Have a look at Knowledge Base document #S1100002433B. If you adjust the 'tcp_keepalive_interval' and others parameters (with 'ndd') you should be able to automatically close the hung connections in a shorter time.

I hope this help !

Regards,

Abel Berger


Jose Luis
Advisor

Re: Sombie Process

Hi John and Abel, thank's for your responses.
The parent process of the zombie is "1", and With "ps -el" the state of this process is "T", but when I do a "ps -fea" there are many iqual procees in the output command with different PID, and don?t die whith the kill command.
Moreover, with the:
tusc -p PID
the message is:
"tusc:retrying attach to process 29349 (process name): Interrupted system call"
What can I do for kill this process?
Thank's Masters

The UNIX world is the tenth planet in the solar system
John Poff
Honored Contributor

Re: Sombie Process

If the parent process ID is one (init), there probably isn't much hope of killing the zombie process. It will take a reboot to get rid of it. What is the name of the zombie process? Is it part of an application or is it a Unix system process? If the zombie is taking little or no CPU time you will probably be fine with it until your next reboot.

JP
Magdi KAMAL
Respected Contributor
Solution

Re: Sombie Process

Hi Jose,

Look, 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 ( and P0 is the parent process of P1).

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

Booting is the only manner by which we can kill Zombies. Zombies are "Neither live nor Died process!!! "

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

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, P1 executes an exit() to allow that P2 be inhereted by init process "PID 1").
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 for P2 process.
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

Magdi KAMAL
Respected Contributor

Re: Sombie Process

Hi again Jose,

Zombies appear when developpers miss program applications.

You have to have a site with them to explain the steps by which a good programming must be to avoid ZOMBIES, and you key sentence is :

"In a client/server model under unix, what developpers do to avoid ZOMBIES ?".

Whatever the response is, map it on the previous steps to fetch out at which moment they(developpers) generate ZOMBIES .

Magdi
Mark van Hassel
Respected Contributor

Re: Sombie Process

Hi,

Just some more info: zombies do not decrease performance, theu do noy use CPU time or memory. They do however take up a process slot so when there are many the proces table (maximum number of processes) will fill up.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Jose Luis
Advisor

Re: Sombie Process

Thanks everybody for your help!!!
The UNIX world is the tenth planet in the solar system