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: php-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 1ccf2c9..30d638a 100644
--- a/sapi/fpm/fpm/fpm_events.c
+++ b/sapi/fpm/fpm/fpm_events.c
@@ -131,6 +131,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 aca7c9e..5481e55 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'
};
@@ -209,6 +210,7 @@ int fpm_signals_init_main(void)
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)) {
@@ -242,6 +244,7 @@ int fpm_signals_init_child(void)
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 533d5a7..64ee547 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -152,7 +152,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
|