From 0399b83ccb6c1f55b443ef9c108484c4724dbea9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Loyet?= Date: Sun, 7 Nov 2010 19:41:28 +0000 Subject: [PATCH] - change signal from SIGTERM to SIGQUIT for killing a child process by the dynamic process manager --- sapi/fpm/fpm/fpm_children.c | 2 +- sapi/fpm/fpm/fpm_process_ctl.c | 5 ++++- sapi/fpm/fpm/fpm_process_ctl.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c index d303cfb038..417c1a2cdc 100644 --- a/sapi/fpm/fpm/fpm_children.c +++ b/sapi/fpm/fpm/fpm_children.c @@ -212,7 +212,7 @@ void fpm_children_bury(struct event_base *base) /* {{{ */ /* if it's been killed because of dynamic process management * don't restart it automaticaly */ - if (child && child->idle_kill && WTERMSIG(status) == SIGTERM) { + if (child && child->idle_kill && WTERMSIG(status) == SIGQUIT) { restart_child = 0; } diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c index d4639b0863..b49767243f 100644 --- a/sapi/fpm/fpm/fpm_process_ctl.c +++ b/sapi/fpm/fpm/fpm_process_ctl.c @@ -143,6 +143,9 @@ int fpm_pctl_kill(pid_t pid, int how) /* {{{ */ case FPM_PCTL_CONT : s = SIGCONT; break; + case FPM_PCTL_QUIT : + s = SIGQUIT; + break; default : break; } @@ -358,7 +361,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now, struct if (idle > wp->config->pm_max_spare_servers && last_idle_child) { last_idle_child->idle_kill = 1; - fpm_pctl_kill(last_idle_child->pid, FPM_PCTL_TERM); + fpm_pctl_kill(last_idle_child->pid, FPM_PCTL_QUIT); wp->idle_spawn_rate = 1; continue; } diff --git a/sapi/fpm/fpm/fpm_process_ctl.h b/sapi/fpm/fpm/fpm_process_ctl.h index 8834d5f3b8..0c8801f69b 100644 --- a/sapi/fpm/fpm/fpm_process_ctl.h +++ b/sapi/fpm/fpm/fpm_process_ctl.h @@ -38,7 +38,8 @@ enum { enum { FPM_PCTL_TERM, FPM_PCTL_STOP, - FPM_PCTL_CONT + FPM_PCTL_CONT, + FPM_PCTL_QUIT }; #endif -- 2.40.0