tcz/PHPTracker — Issue #7: Adding signal handlers to seed server
Author: tcz
Created: 2011-10-28 19:39:40+00:00
State: open

We need to handle SIGINT, SIGQUIT, SIGABRT, SIGKILL both in parent processes and children to release resources properly as well as propagating signals to the whole process tree.

When signal comes:

- remove signal handler (SIG_IGN)
- iterate over children and send signals to them
- close resources and terminate

Also we need to change the wait function in the guardian processes according to the following:

- reading status
- checking pcntl_wifsignaled() for the dead process
- if it's yes, get signal with pcntl_wstopsig() and send it to the current process (guardian)