The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
zombie processes and hung process termination ukndoit Shell Programming and Scripting 2 03-14-2008 02:53 AM
how to handle a zombie process mridula High Level Programming 1 12-06-2005 05:47 PM
zombie daemon process!! rish2005 UNIX for Advanced & Expert Users 1 11-25-2005 09:59 AM
Zombie process swhitney UNIX for Advanced & Expert Users 2 10-22-2004 05:12 PM
Zombie process orca UNIX for Dummies Questions & Answers 8 04-26-2002 02:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-26-2008
jeenat jeenat is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 12
zombie process

Hi
What is the command to find only the zombie processes??
How to write the code in C to fetch the no. of zombie processes??

Thanx
  #2 (permalink)  
Old 03-27-2008
niral niral is offline
Registered User
  
 

Join Date: Mar 2008
Location: Pune
Posts: 4
Thumbs up

Hi,

Use Normal ps command.

# ps aux | awk '{ print $8 " " $2 }' | grep -w Z

Z 4104
Z 5320
Z 2945

To kill a zombie

# kill -9 4104

Sometimes zombie cannot be killed so the solution is to kill the parent process.
  #3 (permalink)  
Old 03-27-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
The use of grep to post-process awk output is kind-of aberrant; just use awk to figure out which lines have a Z.

Code:
ps aux | awk '$8=="Z" { print $2 }'
ps output is somewhat platform-dependent (this seems to work on Linux at least, but might need tweaks for other architectures), and obtaining this information from the kernel on the C level doubly so. On Linux, the proc pseudo-filesystem provides this information. See the proc(5) manual page.
  #4 (permalink)  
Old 03-28-2008
jeenat jeenat is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 12
thanx a lot..

ther is no zombie process currently present in my system. is it possible to create a zombie process?? so that i can see the output.
  #5 (permalink)  
Old 03-28-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by jeenat View Post
thanx a lot..

ther is no zombie process currently present in my system. is it possible to create a zombie process?? so that i can see the output.
In C, have the parent process fork and exec a child process. And then make the parent exit without waiting on the child. This will result in the child process becoming a zombie.
  #6 (permalink)  
Old 03-28-2008
jeenat jeenat is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 12
Smile

thanq sooo much...
Sponsored Links
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0