comparison src/core/nginx.c @ 253:b6793bc5034b

nginx-0.0.2-2004-02-09-10:46:43 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 09 Feb 2004 07:46:43 +0000
parents 84b1c672ec5a
children e6938ca7331a
comparison
equal deleted inserted replaced
252:84b1c672ec5a 253:b6793bc5034b
375 == NGX_ERROR) 375 == NGX_ERROR)
376 { 376 {
377 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, 377 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
378 "can not respawn %s", 378 "can not respawn %s",
379 ngx_processes[i].name); 379 ngx_processes[i].name);
380 continue;
380 } 381 }
382
383 live = 1;
381 384
382 continue; 385 continue;
383 } 386 }
384 387
385 if (ngx_processes[i].pid == ngx_new_binary) { 388 if (ngx_processes[i].pid == ngx_new_binary) {
441 "reconfiguring"); 444 "reconfiguring");
442 } 445 }
443 446
444 if (ngx_reopen) { 447 if (ngx_reopen) {
445 if (ngx_process == NGX_PROCESS_MASTER) { 448 if (ngx_process == NGX_PROCESS_MASTER) {
446 if (ccf->worker_reopen > 0) { 449 if (ccf->worker_reopen != 0) {
447 signo = ngx_signal_value(NGX_REOPEN_SIGNAL); 450 signo = ngx_signal_value(NGX_REOPEN_SIGNAL);
448 ngx_reopen = 0; 451 ngx_reopen = 0;
449 452
450 } else if (ngx_noaccept) { 453 } else if (ngx_noaccept) {
451 ngx_reopen = 0; 454 ngx_reopen = 0;
459 } 462 }
460 463
461 ngx_log_error(NGX_LOG_INFO, cycle->log, 0, 464 ngx_log_error(NGX_LOG_INFO, cycle->log, 0,
462 "reopening logs"); 465 "reopening logs");
463 ngx_reopen_files(cycle, 466 ngx_reopen_files(cycle,
464 ccf->worker_reopen > 0 ? ccf->user : -1); 467 ccf->worker_reopen != 0 ? ccf->user : (uid_t) -1);
465 } 468 }
466 } 469 }
467 470
468 if (signo) { 471 if (signo) {
469 for (i = 0; i < ngx_last_process; i++) { 472 for (i = 0; i < ngx_last_process; i++) {
571 "setuid(%d) failed", ccf->user); 574 "setuid(%d) failed", ccf->user);
572 /* fatal */ 575 /* fatal */
573 exit(2); 576 exit(2);
574 } 577 }
575 } 578 }
579
580 #if (HAVE_PR_SET_DUMPABLE)
581
582 /* allow coredump after setuid() in Linux 2.4.x */
583
584 if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
585 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
586 "prctl(PR_SET_DUMPABLE) failed");
587 }
588
589 #endif
576 590
577 sigemptyset(&set); 591 sigemptyset(&set);
578 592
579 if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) { 593 if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) {
580 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 594 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,