ps -ef|grep efu
root 19693 2564 0 13:56:30 ? 0:00 <defunct>
myusernamehere 19724 12092 0 13:56:39 pts/tk 0:00 grep efu
.... yields my user name... that was not helpful.
I'd like to know how to find and kill this zombie process... if you want a ps -ef just ask. I can't find its parent. It's been on 'top' for a month or so now...
note, i will not post my ps -ef, usernames in prod env. sorry.
suggestions? thanks..
There are two process lines in that response - one is your grep, the other is the zombie process.
ps -ef|grep efu
root 19693 2564 0 13:56:30 ? 0:00 <defunct>
myusernamehere 19724 12092 0 13:56:39 pts/tk 0:00 grep efu
.... yields my user name... that was not helpful.
I'd like to know how to find and kill this zombie process... if you want a ps -ef just ask. I can't find its parent. It's been on 'top' for a month or so now...
note, i will not post my ps -ef, usernames in prod env. sorry.
suggestions? thanks..
No. It was very helpful.
It shows that your zombie's PID is 19693. It will remain a zombie until its parent wait()s for it or dies. Its parent's PID is 2564.
Code:
ps -ef|grep [2]564
will show you ps output that contains the description of the parent process, other children of that process, and possibly some other processes that have 2564 somewhere in their ps output. You want the one where 2564 appears in the 2nd column of the output.
Last edited by Don Cragun; 10-03-2013 at 06:11 PM..
Reason: Fix typos
This User Gave Thanks to Don Cragun For This Post:
No. It was very helpful.
It shows that your zombie's PID is 19693. It will remain a zombie until its parent wait()s for it or dies. Its parent's PID is 2564.
Code:
ps -ef|grep [2]564
will show you ps output that contains the description of the parent process, other children of that process, and possibly some other processes that have 2564 somewhere in their ps output. You want the one where 2564 appears in the 2nd column of the output.
that helps a lot!!! thanks. thats what i was looking for: what to do. 2 steps here. got it. thanks both of you.
oh and i dont think i should kill the parent y/n?
looks important
Having a zombie or two lying around isn't a big deal. The only thing that still exists for a zombie is a process table entry (which includes its process ID and its exit status). Its address space has already been returned to the system and is available for use by other processes.
If you have a lot of zombies, your process table could fill up and you would be unable to start other processes.
Last edited by Don Cragun; 10-04-2013 at 12:21 AM..
Reason: fix typo
This User Gave Thanks to Don Cragun For This Post:
Actually, you can kill zombies; they just won't notice that they've been killed (again).
Code:
kill 0 pid_of_zombie
will complete successfully telling you that the zombie hasn't been reaped yet.
Code:
kill TERM pid_of_zombie
will send a SIGTERM signal to the zombie and will complete successfully (assuming you have permission to send a signal to that process), but the zombie will never notice that the signal was sent nor be able to act upon that signal.
zombies arise from really poor programming practices - failing to call wait() on children. kill DOES NOT KILL A ZOMBIE!! Stop trying.
Are we clear on this point?
What you are seeing is:
Code:
1 Process 2564 is the parent.
2 It calls fork()
3 Process xxxx9 is created.
4 It runs.
5 It exits.
6 The OS twiddles its thumbs
7 The OS decides to make a zombies out of xxxx9
8 Meanwhile 2564 is asleep at the switch.
9 Later on, 2564 comes out of a coma calls wait(), when it wants to fork a new child
xxxx10
10 goto #4 above, continue forever until process 2564 code is fixed.
This is a programming problem. NOT system management. Fix the code behind it.
If your management wants you to get rid of it, get a copy of Stevens & Rago, 'Advanced Programming in the UNIX Environment', look up zombie, show it to the manager. If he can read it, you are good. He will get that it is a programming problem.
These 4 Users Gave Thanks to jim mcnamara For This Post:
I had a problem deleting a zombie process. It refused to be killed.
I even tried kill -9 process# but it refused.
Any other way of killing it? (7 Replies)
i'm writing small http proxy server (accept client -> connect to remote proxy server -> recv client's request -> send to remote proxy server -> get responce from remote proxy server -> send answer to client -> close connection to client and to remote proxy server) and having problems with fork().... (2 Replies)
Hi All
I need help, how can i kill zombies instead of rebooting the system.
Regards
System: sna Tue Apr 5 17:50:23 2005
Load averages: 0.05, 0.15, 0.22
168 processes: 157 sleeping, 5 running, 6 zombies
Cpu states:
CPU LOAD USER NICE... (5 Replies)
Okay, I'm working within ansi C and Sun Solaris 7. I have a problem with zombies. I'm currently using the kill command to return the status of a process. How do I check for Zombie PIDs or the right function to return its PID from within a C program? (1 Reply)