mirror of
https://github.com/nginx/nginx.git
synced 2024-12-24 08:00:14 -06:00
Fixed removing of listening UNIX sockets when "changing binary".
When changing binary, sending a SIGTERM to the new binary's master process should not remove inherited UNIX sockets unless the old binary's master process has exited.
This commit is contained in:
parent
59a0ceb994
commit
da370de990
@ -492,6 +492,7 @@ ngx_add_inherited_sockets(ngx_cycle_t *cycle)
|
||||
ngx_memzero(ls, sizeof(ngx_listening_t));
|
||||
|
||||
ls->fd = (ngx_socket_t) s;
|
||||
ls->inherited = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1070,7 +1070,8 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle)
|
||||
|
||||
if (ls[i].sockaddr->sa_family == AF_UNIX
|
||||
&& ngx_process <= NGX_PROCESS_MASTER
|
||||
&& ngx_new_binary == 0)
|
||||
&& ngx_new_binary == 0
|
||||
&& (!ls[i].inherited || ngx_getppid() != ngx_parent))
|
||||
{
|
||||
u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1;
|
||||
|
||||
|
@ -520,6 +520,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
|
||||
== NGX_OK)
|
||||
{
|
||||
nls[n].fd = ls[i].fd;
|
||||
nls[n].inherited = ls[i].inherited;
|
||||
nls[n].previous = &ls[i];
|
||||
ls[i].remain = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user