diff src/core/ngx_connection.c @ 7662:9c038f5e0464

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.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 01 Jun 2020 20:19:27 +0300
parents e7b2b907c0f8
children b9071b875194 001ec7fce567
line wrap: on
line diff
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -1070,7 +1070,8 @@ ngx_close_listening_sockets(ngx_cycle_t 
 
         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;