process-reaper

Is it possible to adopt a process?

让人想犯罪 __ 提交于 2019-12-20 16:51:06
问题 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 created prior to A's dead, without init becoming an intermediate parent of B? Update-1: Also I would appreciate any comments on why having the possiblity to adopt a process the way I described would be a bad thing or difficult to impossible to

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

纵然是瞬间 提交于 2019-12-13 04:06:35
问题 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 user logs out, I need to remove the user from online.txt (PROBLEM), the parent then signals a reaper() and kills the child. My questions are: Q1: How I can squeeze in additional information to the reaper (such as the username that the user used to

Is it possible to adopt a process?

僤鯓⒐⒋嵵緔 提交于 2019-12-03 04:34:06
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 created prior to A's dead, without init becoming an intermediate parent of B? Update-1: Also I would appreciate any comments on why having the possiblity to adopt a process the way I described would be a bad thing or difficult to impossible to implement. Update-2 - The use case (parent and children refer to process(es)): I have an app using a parent to

process re-parenting: controlling who is the new parent

跟風遠走 提交于 2019-11-27 15:12:50
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 setsid, but no luck. And now that I see this wikipedia article I need advice. In a Unix-like operating system any orphaned process will be immediately adopted by the special init system process. This operation is called re-parenting and occurs automatically. Even though technically the process has the "init" process as its parent, it is still called an

process re-parenting: controlling who is the new parent

二次信任 提交于 2019-11-26 17:06:42
问题 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 setsid, but no luck. And now that I see this wikipedia article I need advice. In a Unix-like operating system any orphaned process will be immediately adopted by the special init system process. This operation is called re-parenting and occurs