The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can a child process return a specific value to a parent process ? Ametis1970 High Level Programming 8 04-10-2008 12:22 AM
kernel: Out of Memory: Killed process 2990 bsandeep_80 UNIX for Advanced & Expert Users 7 03-25-2008 03:49 PM
Status of child job after parent is killed anjul_thegreat High Level Programming 7 06-29-2007 07:36 AM
how to find the chid process id from given parent process id guhas Shell Programming and Scripting 3 10-13-2005 09:13 AM
process not getting killed finster UNIX for Dummies Questions & Answers 5 03-26-2005 01:26 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 05-06-2008
Puntino Puntino is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 30
Who is the parent of a killed process ?

Suppose we have the following process tree:

init-> ProcessA->processB->processC

then I kill processB

Who is the parent of the processC?
init or the processA
  #2 (permalink)  
Old 05-06-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,126
init will inherit processC.
  #3 (permalink)  
Old 05-07-2008
Puntino Puntino is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 30
Thank you, Why is init the parent?
  #4 (permalink)  
Old 05-07-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,126
Quote:
Originally Posted by Puntino View Post
Thank you, Why is init the parent?
Process A can be expected to keep track of its own children. But it has no idea how many children Process B created. If processes all must inherit grandchildren, great-grandchildren, and so on, then every process must be prepared to reap an unending number of children it knows nothing about. That's a lot to ask of every process. So we ask it only of init.

By the way, some versions of unix have a ptrace() system call intended to be only used by debuggers. Most versions of ptrace can allow a process to adopt another process and become its parent. There are restrictions on this... both processes must be owned by the same uid and the adoptee cannot be suid.
  #5 (permalink)  
Old 05-09-2008
Puntino Puntino is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 30
many thanks Perderabo,

Another doubt that I have is: after a child exits or is killed, in my example processB, does it send a SIGCHLD to its parent (in this case processA)?
  #6 (permalink)  
Old 05-13-2008
frozentin frozentin is offline
Registered User
  
 

Join Date: May 2008
Location: Vienna, VA + Bombay, India
Posts: 109
Quote:
Originally Posted by Puntino View Post
many thanks Perderabo,

Another doubt that I have is: after a child exits or is killed, in my example processB, does it send a SIGCHLD to its parent (in this case processA)?
Please correct me if I am wrong here.

I would guess not, otherwise we wouldn't end up with zombie processes.

Last edited by frozentin; 05-13-2008 at 03:05 AM.. Reason: Edit.
Closed Thread

Bookmarks

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:55 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