php-fpm-do-reload-on-SIGHUP
authorDebian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Sat, 2 May 2015 08:26:56 +0000 (10:26 +0200)
committerOndřej Surý <ondrej@debian.org>
Sun, 3 Aug 2025 07:32:21 +0000 (09:32 +0200)
Gbp-Pq: Name 0021-php-fpm-do-reload-on-SIGHUP.patch

sapi/fpm/fpm/fpm_events.c
sapi/fpm/fpm/fpm_signals.c
sapi/fpm/php-fpm.8.in

index 1ccf2c9c5490a215f9562c0545a1985371ee2de0..30d638a8f1b74a20f564f5c20b53975e05d3b1a8 100644 (file)
@@ -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) {
index aca7c9ed58cc46699300e7f1d0b7d86e12b57e50..5481e55c4e285d49a644e1c948c05998bdb6494d 100644 (file)
@@ -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)) {
 
index 533d5a7b63fd51810b0632fa1817c131925c1e47..64ee547f8fa8eb3fe5d41df7653a8b17842c535a 100644 (file)
@@ -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