From 7af6b16936b630feabecbce0dbc9cf84b4943481 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 9 Feb 2004 07:46:43 +0000 Subject: nginx-0.0.2-2004-02-09-10:46:43 import --- src/core/nginx.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/core/nginx.c') diff --git a/src/core/nginx.c b/src/core/nginx.c index 634035637..fe78ab4e6 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -377,8 +377,11 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx) ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "can not respawn %s", ngx_processes[i].name); + continue; } + live = 1; + continue; } @@ -443,7 +446,7 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx) if (ngx_reopen) { if (ngx_process == NGX_PROCESS_MASTER) { - if (ccf->worker_reopen > 0) { + if (ccf->worker_reopen != 0) { signo = ngx_signal_value(NGX_REOPEN_SIGNAL); ngx_reopen = 0; @@ -461,7 +464,7 @@ static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx) ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "reopening logs"); ngx_reopen_files(cycle, - ccf->worker_reopen > 0 ? ccf->user : -1); + ccf->worker_reopen != 0 ? ccf->user : (uid_t) -1); } } @@ -574,6 +577,17 @@ static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data) } } +#if (HAVE_PR_SET_DUMPABLE) + + /* allow coredump after setuid() in Linux 2.4.x */ + + if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + "prctl(PR_SET_DUMPABLE) failed"); + } + +#endif + sigemptyset(&set); if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) { -- cgit