If the child dies, the parent should receive SIGCHLD. The CHLD handler can set a global flag to restart the child before sleeping again.
Another handy way to check that a child is running is to call kill 0, $childpid or spawn_another_child();
Don't wait inside a signal handler until a child starts. That gets you nested handlers, playing dangerous games with the kernel. Instead, try something in the parent's mainline code like:
sleep 1 until kill 0, $childpid;After Compline,
Zaxo
In reply to Re: Awake from sleep()
by Zaxo
in thread Awake from sleep()
by cmilfo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |