]> granicus.if.org Git - php/commitdiff
- Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an...
authorJerome Loyet <fat@php.net>
Sat, 26 May 2012 16:44:35 +0000 (18:44 +0200)
committerJerome Loyet <fat@php.net>
Sat, 26 May 2012 16:44:35 +0000 (18:44 +0200)
sapi/fpm/fpm/fpm.c
sapi/fpm/fpm/fpm.h
sapi/fpm/fpm/fpm_main.c
sapi/fpm/fpm/fpm_unix.c

index 176dbaf32ec874ce66a4042eff93d19007ab3c48..dab415d123156985d3eb38506992d4e7853f5375 100644 (file)
@@ -39,6 +39,7 @@ struct fpm_globals_s fpm_globals = {
        .test_successful = 0,
        .heartbeat = 0,
        .run_as_root = 0,
+       .send_config_signal = 0,
 };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
index b0bed0a07415a7585377b987e9abfdbcbd7bae46..7a2903d07d3e602dbe8e3cd5d1b41a1733e8c640 100644 (file)
@@ -55,6 +55,7 @@ struct fpm_globals_s {
        int test_successful;
        int heartbeat;
        int run_as_root;
+       int send_config_signal;
 };
 
 extern struct fpm_globals_s fpm_globals;
index 08477da8d1b6fdea0c4a72a82933a0c0c333f6a1..9c314f51c611f235148f0d6eb6bf77ed830c9184 100644 (file)
@@ -1804,14 +1804,14 @@ consult the installation file that came with this distribution, or visit \n\
 
        if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 
-               if (fpm_global_config.daemonize) {
+               if (fpm_globals.send_config_signal) {
                        zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
                        kill(getppid(), SIGUSR2);
                }
                return FPM_EXIT_CONFIG;
        }
 
-       if (fpm_global_config.daemonize) {
+       if (fpm_globals.send_config_signal) {
                zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
                kill(getppid(), SIGUSR1);
        }
index 0f4d383c24abcd43c7922290b1d099feeb6d78b7..5c5e37c3a4f466e53707ccebbf4974464f989d19 100644 (file)
@@ -305,6 +305,7 @@ int fpm_unix_init_main() /* {{{ */
                                /* restore USR1 and USR2 sigaction */
                                sigaction(SIGUSR1, &oldact_usr1, NULL);
                                sigaction(SIGUSR2, &oldact_usr2, NULL);
+                               fpm_globals.send_config_signal = 1;
                                break;
 
                        default : /* parent */