File: 0039-php5-fpm-do-reload-on-SIGHUP.patch

package info (click to toggle)
php5 5.6.33%2Bdfsg-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 157,872 kB
  • sloc: ansic: 756,065; php: 22,030; sh: 12,311; cpp: 8,771; xml: 6,179; yacc: 1,564; exp: 1,514; makefile: 1,467; pascal: 1,147; awk: 538; perl: 315; sql: 22
file content (67 lines) | stat: -rw-r--r-- 2,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Date: Sat, 2 May 2015 10:26:56 +0200
Subject: php5-fpm-do-reload-on-SIGHUP

---
 sapi/fpm/fpm/fpm_events.c  | 5 +++++
 sapi/fpm/fpm/fpm_signals.c | 3 +++
 sapi/fpm/php-fpm.8.in      | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sapi/fpm/fpm/fpm_events.c b/sapi/fpm/fpm/fpm_events.c
index ce5d543..63de0a4 100644
--- a/sapi/fpm/fpm/fpm_events.c
+++ b/sapi/fpm/fpm/fpm_events.c
@@ -113,6 +113,11 @@ static void fpm_got_signal(struct fpm_event_s *ev, short which, void *arg) /* {{
 				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) {
diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c
index c5d0692..9fae650 100644
--- a/sapi/fpm/fpm/fpm_signals.c
+++ b/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)) {
 
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index 794f508..b1bcf08 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -150,7 +150,7 @@ Once started, php-fpm then responds to several POSIX signals:
 .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