LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-08-2006, 04:31 PM   #1
thecoolguy
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
how can i find orphan processes?


Hi,
I am trying to find orphan processes and kill them. How may I do so effectively?
 
Old 04-08-2006, 04:46 PM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Sure would be helpful if we had even a vague hint at what distro you're using.

If it happens to be Debian ... deborphan
 
Old 04-09-2006, 01:01 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi -- just have to handle SIGCHLD
Code:
sig_atomic_t chid_exit_status;

void clean_up_child (int sig_num) {
  int status;
  wait(&status);
  child_exit_status = status; // in case we need this later
}

int main() {
  struct sigaction sigchld_action;
  memset (&sigchld_action,0,sizeof(sigchld_action));
  sigchld_action.sa_handler = &clean_up_child;
  sigaction (SIGCHLD, &sigchld_action, NULL);
  // fork off some children
  return 0;
}
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ORPHAN (no passwd entry) markus1982 Linux - General 6 08-19-2010 08:57 AM
Find processes paraiso Linux - Newbie 9 04-28-2005 03:36 PM
orphan packages and libraries alexrait1 Slackware 1 07-05-2004 06:18 PM
how to find CPU and IO bound processes tuxrhl Linux - General 0 11-22-2003 01:11 AM
Orphan Processes LiquidPenguin Linux - Newbie 0 07-15-2003 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:58 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