LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-26-2011, 04:04 AM   #1
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Rep: Reputation: 17
Reaping a zombie process


How can I reap a zombie process on Linux.

On Solaris I use the preap command but I can't find an equivalent command on Linux.

I can't kill the process because it's already dead and by it's nature the parent process is dead, so I can't kill that.
Assume that kill -1, -9 don't work.

I've searched the forums but have yet to find a method of removing it from the process table without compiling any C.

Is there a Linux command or something I set in /proc/<pid> to remove the process.

Last edited by dazdaz; 04-26-2011 at 04:05 AM.
 
Old 04-26-2011, 05:18 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well by its nature the parent process is not necessarily dead at all, what is its parent? If it's gone then it would be re-parented up as far as the init process.
 
1 members found this post helpful.
Old 04-26-2011, 10:49 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,512

Rep: Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656Reputation: 2656
Zombie process

I never mess with the zombies.

As long as you leave them alone they hurt nothing, and the tables are fully cleaned by your next restart.
 
Old 04-26-2011, 12:34 PM   #4
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Original Poster
Rep: Reputation: 17
If the parent process was alive then I would send a SIGCHILD to the parent which would reap it's children however this is not an option in my case because the ppid is 1.

Although there is little impact, an extra process slot is used up, I still want to remove the zombie process.

Is it technically possible to do that under those circumstances without rebooting on Linux ?

Last edited by dazdaz; 05-01-2011 at 04:16 PM.
 
Old 05-01-2011, 03:49 PM   #5
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Original Poster
Rep: Reputation: 17
Is it possible to attach kdb to init and send a waitpid() function. Would this free up the process slot ? A zombie may not hurt the system but I am curious to find a workable method.

Remember that init is now the ppid.

Where 23300 is the zombie pid slot. I use this as an example, however I have no practical experience with kgdb so the commands won't work.

I am not even sure if you can run kdb and activating it witin the kernel without stopping kernel execution from the same host.

# kgdb -p 1
(gdb) call waitpid(23300, 0, 0)
(gdb) quit

Last edited by dazdaz; 05-01-2011 at 04:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Zombie process awanish.tiwari Linux - Newbie 5 01-21-2011 12:45 PM
zombie process sang_froid Linux - Server 1 05-25-2010 08:23 AM
Zombie Process N|k0N Linux - Security 8 09-22-2007 02:01 AM
zombie process ihatecomputers Linux - Software 2 03-24-2005 07:09 AM
Zombie process and dialup pbm Linux - General 2 06-27-2002 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration