aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c18
1 files changed, 16 insertions, 2 deletions
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) {