So I have spawned one child process that I keep alive as long as the main process is alive. Since I use it very often I see no reason to kill it every few seconds.
How can I be sure to close the child process upon exiting the main one whether it crashed or not since if I don't it will become orphan. Also if I happen to get an orphan child what should I do?