diff -Naur php-7.0.20.orig/sapi/fpm/fpm/fpm_children.h php-7.0.20/sapi/fpm/fpm/fpm_children.h --- php-7.0.20.orig/sapi/fpm/fpm/fpm_children.h 2017-06-06 12:46:01.000000000 +0200 +++ php-7.0.20/sapi/fpm/fpm/fpm_children.h 2017-07-05 18:40:18.655742777 +0200 @@ -31,6 +31,7 @@ int idle_kill; pid_t pid; int scoreboard_i; + int sigterm_sent; }; #endif diff -Naur php-7.0.20.orig/sapi/fpm/fpm/fpm_process_ctl.c php-7.0.20/sapi/fpm/fpm/fpm_process_ctl.c --- php-7.0.20.orig/sapi/fpm/fpm/fpm_process_ctl.c 2017-06-06 12:46:01.000000000 +0200 +++ php-7.0.20/sapi/fpm/fpm/fpm_process_ctl.c 2017-07-05 18:40:18.656742766 +0200 @@ -53,6 +53,7 @@ static void fpm_pctl_action(struct fpm_event_s *ev, short which, void *arg) /* {{{ */ { + ev->flags &= ~FPM_EV_PERSIST; fpm_pctl(FPM_PCTL_STATE_UNSPECIFIED, FPM_PCTL_ACTION_TIMEOUT); } /* }}} */ @@ -61,6 +62,7 @@ { fpm_event_set_timer(&pctl_event, 0, &fpm_pctl_action, NULL); fpm_event_add(&pctl_event, sec * 1000); + pctl_event.flags |= FPM_EV_PERSIST; return 0; } /* }}} */ @@ -136,6 +138,9 @@ case FPM_PCTL_QUIT : s = SIGQUIT; break; + case FPM_PCTL_KILL : + s = SIGKILL; + break; default : break; } diff -Naur php-7.0.20.orig/sapi/fpm/fpm/fpm_process_ctl.h php-7.0.20/sapi/fpm/fpm/fpm_process_ctl.h --- php-7.0.20.orig/sapi/fpm/fpm/fpm_process_ctl.h 2017-06-06 12:46:01.000000000 +0200 +++ php-7.0.20/sapi/fpm/fpm/fpm_process_ctl.h 2017-07-05 18:53:43.034694660 +0200 @@ -46,7 +46,8 @@ FPM_PCTL_TERM, FPM_PCTL_STOP, FPM_PCTL_CONT, - FPM_PCTL_QUIT + FPM_PCTL_QUIT, + FPM_PCTL_KILL }; #endif diff -Naur php-7.0.20.orig/sapi/fpm/fpm/fpm_request.c php-7.0.20/sapi/fpm/fpm/fpm_request.c --- php-7.0.20.orig/sapi/fpm/fpm/fpm_request.c 2017-06-06 12:46:01.000000000 +0200 +++ php-7.0.20/sapi/fpm/fpm/fpm_request.c 2017-07-05 18:40:18.656742766 +0200 @@ -271,7 +271,8 @@ #endif if (terminate_timeout && tv.tv_sec >= terminate_timeout) { str_purify_filename(purified_script_filename, proc.script_filename, sizeof(proc.script_filename)); - fpm_pctl_kill(child->pid, FPM_PCTL_TERM); + fpm_pctl_kill(child->pid, (child->sigterm_sent) ? FPM_PCTL_KILL : FPM_PCTL_TERM); + child->sigterm_sent = 1; zlog(ZLOG_WARNING, "[pool %s] child %d, script '%s' (request: \"%s %s%s%s\") execution timed out (%d.%06d sec), terminating", child->wp->config->name, (int) child->pid, purified_script_filename, proc.request_method, proc.request_uri,