Mercurial > hg > nginx
comparison src/os/unix/ngx_process_cycle.c @ 9268:6a3ee145d0b5
Core: made it possible to disable PID files with "pid off".
While it is not generally recommended, this might be beneficial in some
configurations, such as with immutable images and direct control by
a service manager.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 13 May 2024 06:13:03 +0300 |
parents | 791ead216b03 |
children |
comparison
equal
deleted
inserted
replaced
9267:9a5e2296c1be | 9268:6a3ee145d0b5 |
---|---|
617 if (ngx_processes[i].pid == ngx_new_binary) { | 617 if (ngx_processes[i].pid == ngx_new_binary) { |
618 | 618 |
619 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, | 619 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, |
620 ngx_core_module); | 620 ngx_core_module); |
621 | 621 |
622 if (ngx_rename_file((char *) ccf->oldpid.data, | 622 if (ccf->pid.len |
623 (char *) ccf->pid.data) | 623 && ngx_rename_file((char *) ccf->oldpid.data, |
624 == NGX_FILE_ERROR) | 624 (char *) ccf->pid.data) |
625 == NGX_FILE_ERROR) | |
625 { | 626 { |
626 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | 627 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, |
627 ngx_rename_file_n " %s back to %s failed " | 628 ngx_rename_file_n " %s back to %s failed " |
628 "after the new binary process \"%s\" exited", | 629 "after the new binary process \"%s\" exited", |
629 ccf->oldpid.data, ccf->pid.data, ngx_argv[0]); | 630 ccf->oldpid.data, ccf->pid.data, ngx_argv[0]); |