LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2003, 06:45 AM   #1
kghoshal
LQ Newbie
 
Registered: Jul 2003
Posts: 6

Rep: Reputation: 0
Question Zombie Process Handling


Is there a special meachanism in Linux to handle Zombie Processes?
 
Old 07-21-2003, 06:49 AM   #2
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
what exactly is your question?
if you are asking if the kernel sees if a parent process is waiting
for a child process it forked, then no....i dont think so..
if your parent doesnt wait for a child process and the child exits,
it (child) would become a zombie...a condition that would go either when the parent process exits or when the system restarts
 
Old 07-21-2003, 09:10 AM   #3
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
Below is Beej's code snip and explanation for handling zombies under any *nix. Seems to work if you include the right headers.

Code:
        sa.sa_handler = sigchld_handler; // reap all dead processes
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = SA_RESTART;
        if (sigaction(SIGCHLD, &sa, NULL) == -1) {
            perror("sigaction");
            exit(1);
        }
(Also, this whole sigaction() thing might be new to you--that's ok. The code that's there is responsible for reaping zombie processes that appear as the fork()ed child processes exit. If you make lots of zombies and don't reap them, your system administrator will become agitated.)
 
  


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 N|k0N Linux - Security 8 09-22-2007 02:01 AM
Zombie process - XMMS FeaRx Debian 3 11-04-2005 03:27 AM
Zombie process - gnomerc Artik Mandriva 0 05-10-2005 01:45 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 - Newbie

All times are GMT -5. The time now is 07:32 AM.

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