User:Paolo Rodriguez/Wishlist: Proper Signal Handling

From PHP-FPM

Jump to: navigation, search

php-fpm needs to correct its signal handling behavior to conform to set standards and common practices. This is most desirable, if not required, if ever php-fpm is ever to be integrated with the main PHP distribution.

Issue

As of the php-fpm v0.5.11 patch for PHP v5.2.10, signals are handled as such:

SIGINT Immediate termination
SIGTERM
SIGQUIT Graceful stop
SIGUSR1 Reopen logfile
SIGUSR2 Graceful reload of all workers and configuration

This is contrary to standard signal handling of SIGTERM and SIGQUIT. SIGHUP is also unhandled while being a common signal used to force a reload of configuration.

Fix

Change signal handling to:

SIGINT Immediate termination
SIGTERM Graceful stop
SIGQUIT Core dump
SIGUSR1 Reopen logfile
SIGUSR2 Graceful reload of all workers and configuration
SIGHUP