Questions tagged [process-reaper]

The process which becomes the parent of a child process when the child's parent ends.

4 questions
26
votes
4 answers

Is it possible to adopt a process?

Process A fork()s process B. Process A dies and therefore init adopts B. A watchdog creates process C. Is it somehow possible for C to adopt B from init? Update: Or would it even be possible to have C adopt B directly (when A dies), if C were…
alk
  • 69,737
  • 10
  • 105
  • 255
8
votes
3 answers

process re-parenting: controlling who is the new parent

Is the new parent always "init" or is there some way to control who gets to be the new parent? Wikipedia seems indicates that it's always "init". I really hope that this is not the case. I have tried everything I can think of with setpgid and…
neoneye
  • 50,398
  • 25
  • 166
  • 151
2
votes
1 answer

Fork command in shell to print process ids

I am trying to print the pid of the processes after running the fork() command. Here is my code- #include #include int main(void) { int pid; pid=fork(); if(pid==0) printf("I am the child.My pid is %d .My…
user4685154
0
votes
2 answers

How to squeeze in additional parameters to a reaper function when a parent is signalled to kill a child (c)?

I'm writing a TCP server that functions very much like a chatroom and came across this question. When a user connects, a child process is created to serve the user. When a user logs in, I store his username into a text file, online.txt But when a…
Some Noob Student
  • 14,186
  • 13
  • 65
  • 103