![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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-09-2008 08:22 PM |
| kernel: Out of Memory: Killed process 2990 | bsandeep_80 | UNIX for Advanced & Expert Users | 7 | 03-25-2008 12:49 PM |
| Status of child job after parent is killed | anjul_thegreat | High Level Programming | 7 | 06-29-2007 03:36 AM |
| how to find the chid process id from given parent process id | guhas | Shell Programming and Scripting | 3 | 10-13-2005 05:13 AM |
| process not getting killed | finster | UNIX for Dummies Questions & Answers | 5 | 03-26-2005 10:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
init will inherit processC.
|
|
#3
|
|||
|
|||
|
Thank you, Why is init the parent?
|
|
#4
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Quote:
I would guess not, otherwise we wouldn't end up with zombie processes. Last edited by frozentin; 05-12-2008 at 11:05 PM. Reason: Edit. |
|
#7
|
||||
|
||||
|
If the parent installed a signal handler for SIGCLD, it will get a signal. But the sender is the kernel, not the dead process.
|
||||
| Google The UNIX and Linux Forums |