mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 10:52:47 +08:00
nginx-0.0.1-2004-01-09-18:47:42 import
This commit is contained in:
parent
f2954c3e31
commit
baf61e10d5
@ -235,7 +235,7 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
ngx_uint_t i, live;
|
ngx_uint_t i, live;
|
||||||
sigset_t set, wset;
|
sigset_t set, wset;
|
||||||
|
|
||||||
delay = 1000;
|
delay = 125;
|
||||||
|
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, SIGCHLD);
|
sigaddset(&set, SIGCHLD);
|
||||||
@ -299,7 +299,7 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
"quit cycle");
|
"quit cycle");
|
||||||
|
|
||||||
if (delay < 10000) {
|
if (delay < 15000) {
|
||||||
delay *= 2;
|
delay *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +345,8 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (live == 0 && ngx_process == NGX_PROCESS_QUITING) {
|
if (live == 0) {
|
||||||
|
if (ngx_process == NGX_PROCESS_QUITING) {
|
||||||
if (ngx_delete_file(ctx->pid.name.data)
|
if (ngx_delete_file(ctx->pid.name.data)
|
||||||
== NGX_FILE_ERROR)
|
== NGX_FILE_ERROR)
|
||||||
{
|
{
|
||||||
@ -356,6 +357,10 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
ctx->pid.name.data);
|
ctx->pid.name.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else { /* NGX_PROCESS_PAUSED */
|
||||||
|
ngx_pause = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "exit");
|
ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "exit");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@ -363,8 +368,12 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_terminate) {
|
if (ngx_terminate) {
|
||||||
|
if (delay > 10000) {
|
||||||
|
ngx_signal_processes(cycle, SIGKILL);
|
||||||
|
} else {
|
||||||
ngx_signal_processes(cycle,
|
ngx_signal_processes(cycle,
|
||||||
ngx_signal_value(NGX_TERMINATE_SIGNAL));
|
ngx_signal_value(NGX_TERMINATE_SIGNAL));
|
||||||
|
}
|
||||||
ngx_process = NGX_PROCESS_QUITING;
|
ngx_process = NGX_PROCESS_QUITING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,7 +383,7 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
ngx_process = NGX_PROCESS_QUITING;
|
ngx_process = NGX_PROCESS_QUITING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_pause || ngx_process != NGX_PROCESS_PAUSED) {
|
if (ngx_pause) {
|
||||||
ngx_signal_processes(cycle,
|
ngx_signal_processes(cycle,
|
||||||
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
|
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
|
||||||
ngx_process = NGX_PROCESS_PAUSED;
|
ngx_process = NGX_PROCESS_PAUSED;
|
||||||
@ -404,10 +413,18 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
|
|||||||
ngx_reopen = 0;
|
ngx_reopen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
for (i = 0; i < ngx_last_process; i++) {
|
||||||
|
if (!ngx_processes[i].detached) {
|
||||||
|
ngx_processes[i].signal = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
first = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_pause) {
|
}
|
||||||
ngx_pause = 0;
|
|
||||||
|
if (ngx_process == NGX_PROCESS_PAUSED) {
|
||||||
ngx_process = NGX_PROCESS_MASTER;
|
ngx_process = NGX_PROCESS_MASTER;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user