Hacker News new | ask | show | jobs
by azianmike 3807 days ago
I might be totally wrong, but isn't this a good way to get orphaned processes? Kill the parent arbitrarily with SIGTERM (I don't think this automatically cleans up the children/forked processes) and viola, you've got an orphaned process.
1 comments

Using this would require whatever process you start to handle SIGTERM properly. Most processes spawning children do this, but it's no guarantee and one needs to be aware of this.

In my experience, processes doing IPC with parent gets notified of parental death by EOF on the socketpair/pipe it's using to communicate with the parent. This is easy to reason about and most people check return values from I/O functions. Parents spawning children and only caring about SIGCHLD are more prone to not have the correct signal handlers set up by its dev(s).

IMO, any process spawning children w/o proper signal handlers are not good citizens.