php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php5-fpm-do-reload-on-SIGHUP.patch for FPM related Bug #67553

Patch version 2014-07-02 10:12 UTC

Return to Bug #67553 | Download this patch
Patch Revisions:

Developer: ondrej@php.net

--- php5.orig/sapi/fpm/fpm/fpm_events.c
+++ php5/sapi/fpm/fpm/fpm_events.c
@@ -113,6 +113,11 @@ static void fpm_got_signal(struct fpm_ev
 				zlog(ZLOG_NOTICE, "Reloading in progress ...");
 				fpm_pctl(FPM_PCTL_STATE_RELOADING, FPM_PCTL_ACTION_SET);
 				break;
+			case 'H' :                  /* SIGHUP */
+				zlog(ZLOG_DEBUG, "received SIGHUP");
+				zlog(ZLOG_NOTICE, "Reloading in progress ...");
+				fpm_pctl(FPM_PCTL_STATE_RELOADING, FPM_PCTL_ACTION_SET);
+				break;
 		}
 
 		if (fpm_globals.is_child) {
--- php5.orig/sapi/fpm/fpm/fpm_signals.c
+++ php5/sapi/fpm/fpm/fpm_signals.c
@@ -160,6 +160,7 @@ static void sig_handler(int signo) /* {{
 		[SIGINT]  = 'I',
 		[SIGUSR1] = '1',
 		[SIGUSR2] = '2',
+		[SIGHUP]  = 'H',
 		[SIGQUIT] = 'Q',
 		[SIGCHLD] = 'C'
 	};
@@ -206,6 +207,7 @@ int fpm_signals_init_main() /* {{{ */
 	    0 > sigaction(SIGINT,   &act, 0) ||
 	    0 > sigaction(SIGUSR1,  &act, 0) ||
 	    0 > sigaction(SIGUSR2,  &act, 0) ||
+	    0 > sigaction(SIGHUP,   &act, 0) ||
 	    0 > sigaction(SIGCHLD,  &act, 0) ||
 	    0 > sigaction(SIGQUIT,  &act, 0)) {
 
@@ -235,6 +237,7 @@ int fpm_signals_init_child() /* {{{ */
 	    0 > sigaction(SIGINT,   &act_dfl,  0) ||
 	    0 > sigaction(SIGUSR1,  &act_dfl,  0) ||
 	    0 > sigaction(SIGUSR2,  &act_dfl,  0) ||
+	    0 > sigaction(SIGHUP,   &act_dfl,  0) ||
 	    0 > sigaction(SIGCHLD,  &act_dfl,  0) ||
 	    0 > sigaction(SIGQUIT,  &act,      0)) {
 
--- php5.orig/sapi/fpm/php-fpm.8.in
+++ php5/sapi/fpm/php-fpm.8.in
@@ -137,7 +137,7 @@ Once started, php-fpm then responds to s
 .TP
 .B SIGUSR1 			\fPre-open log file
 .TP
-.B SIGUSR2 			\fPgraceful reload of all workers + reload of fpm conf/binary
+.B SIGUSR2,SIGHUP		\fPgraceful reload of all workers + reload of fpm conf/binary
 .RE
 .PD 1
 .P
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC