mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -06:00
add NGX_PROCESS_HELPER process status
This commit is contained in:
parent
8019121120
commit
72db760eca
@ -634,7 +634,7 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle)
|
||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||
|
||||
if (ls[i].sockaddr->sa_family == AF_UNIX
|
||||
&& ngx_process != NGX_PROCESS_WORKER
|
||||
&& ngx_process <= NGX_PROCESS_MASTER
|
||||
&& ngx_new_binary == 0)
|
||||
{
|
||||
u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1;
|
||||
|
@ -72,7 +72,7 @@ ngx_poll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
|
||||
nevents = 0;
|
||||
}
|
||||
|
||||
if (ngx_process == NGX_PROCESS_WORKER
|
||||
if (ngx_process >= NGX_PROCESS_WORKER
|
||||
|| cycle->old_cycle == NULL
|
||||
|| cycle->old_cycle->connection_n < cycle->connection_n)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer)
|
||||
nevents = 0;
|
||||
}
|
||||
|
||||
if (ngx_process == NGX_PROCESS_WORKER
|
||||
if (ngx_process >= NGX_PROCESS_WORKER
|
||||
|| cycle->old_cycle == NULL
|
||||
|| cycle->old_cycle->connection_n < cycle->connection_n)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer)
|
||||
nevents = 0;
|
||||
}
|
||||
|
||||
if (ngx_process == NGX_PROCESS_WORKER
|
||||
if (ngx_process >= NGX_PROCESS_WORKER
|
||||
|| cycle->old_cycle == NULL
|
||||
|| cycle->old_cycle->connection_n < cycle->connection_n)
|
||||
{
|
||||
|
@ -388,6 +388,7 @@ ngx_signal_handler(int signo)
|
||||
break;
|
||||
|
||||
case NGX_PROCESS_WORKER:
|
||||
case NGX_PROCESS_HELPER:
|
||||
switch (signo) {
|
||||
|
||||
case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
|
||||
|
@ -714,6 +714,8 @@ ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
|
||||
ngx_uint_t i;
|
||||
ngx_connection_t *c;
|
||||
|
||||
ngx_process = NGX_PROCESS_WORKER;
|
||||
|
||||
ngx_worker_process_init(cycle, 1);
|
||||
|
||||
ngx_setproctitle("worker process");
|
||||
@ -829,8 +831,6 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_uint_t priority)
|
||||
ngx_core_conf_t *ccf;
|
||||
ngx_listening_t *ls;
|
||||
|
||||
ngx_process = NGX_PROCESS_WORKER;
|
||||
|
||||
if (ngx_set_environment(cycle, NULL) == NULL) {
|
||||
/* fatal */
|
||||
exit(2);
|
||||
@ -1289,6 +1289,8 @@ ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data)
|
||||
|
||||
cycle->connection_n = 512;
|
||||
|
||||
ngx_process = NGX_PROCESS_HELPER;
|
||||
|
||||
ngx_worker_process_init(cycle, 0);
|
||||
|
||||
ngx_close_listening_sockets(cycle);
|
||||
|
@ -21,8 +21,9 @@
|
||||
|
||||
#define NGX_PROCESS_SINGLE 0
|
||||
#define NGX_PROCESS_MASTER 1
|
||||
#define NGX_PROCESS_WORKER 2
|
||||
#define NGX_PROCESS_SIGNALLER 3
|
||||
#define NGX_PROCESS_SIGNALLER 2
|
||||
#define NGX_PROCESS_WORKER 3
|
||||
#define NGX_PROCESS_HELPER 4
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
@ -48,11 +48,6 @@ typedef struct {
|
||||
} ngx_exec_ctx_t;
|
||||
|
||||
|
||||
#define NGX_PROCESS_SINGLE 0
|
||||
#define NGX_PROCESS_MASTER 1
|
||||
#define NGX_PROCESS_WORKER 2
|
||||
|
||||
|
||||
ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle, char *name, ngx_int_t respawn);
|
||||
ngx_pid_t ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx);
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
#define NGX_PROCESS_SINGLE 0
|
||||
#define NGX_PROCESS_MASTER 1
|
||||
#define NGX_PROCESS_WORKER 2
|
||||
#define NGX_PROCESS_SIGNALLER 3
|
||||
#define NGX_PROCESS_SIGNALLER 2
|
||||
#define NGX_PROCESS_WORKER 3
|
||||
|
||||
|
||||
void ngx_master_process_cycle(ngx_cycle_t *cycle);
|
||||
|
Loading…
Reference in New Issue
Block a user