in reply to PERL: stop and restart parent process without killing child
...later while child not finished (EPG updates...), restart parent process
Problem is, you can't do any "re-parenting" of processes, and only parents can waitpid for their children. Hence, your while (! waitpid($pid, WNOHANG)) {...} loop would no longer work or make sense with a new process...
Personally, I would just divide the task into two separate programs, the EPG updater and a monitoring process. The latter checks periodically via kill 0, $pid_of_EPG, or the existence of some flag file, etc. whether the EPG process is still running.
|
|---|