aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_connection.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2020-06-01 20:19:27 +0300
committerRuslan Ermilov <ru@nginx.com>2020-06-01 20:19:27 +0300
commitda370de9904e00f48e59e92f8bff29d5fe6a3ff2 (patch)
treef9d25115e21c27fe81d90679cfa8f844018d00e1 /src/core/ngx_connection.c
parent59a0ceb9947df7a082a239808a0dd56b5c8ceda6 (diff)
downloadnginx-da370de9904e00f48e59e92f8bff29d5fe6a3ff2.tar.gz
nginx-da370de9904e00f48e59e92f8bff29d5fe6a3ff2.zip
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.
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r--src/core/ngx_connection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 33682532a..88fefcea2 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -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;