Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
7661:8cadaf7e7231 | 7662:9c038f5e0464 |
---|---|
1068 | 1068 |
1069 #if (NGX_HAVE_UNIX_DOMAIN) | 1069 #if (NGX_HAVE_UNIX_DOMAIN) |
1070 | 1070 |
1071 if (ls[i].sockaddr->sa_family == AF_UNIX | 1071 if (ls[i].sockaddr->sa_family == AF_UNIX |
1072 && ngx_process <= NGX_PROCESS_MASTER | 1072 && ngx_process <= NGX_PROCESS_MASTER |
1073 && ngx_new_binary == 0) | 1073 && ngx_new_binary == 0 |
1074 && (!ls[i].inherited || ngx_getppid() != ngx_parent)) | |
1074 { | 1075 { |
1075 u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1; | 1076 u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1; |
1076 | 1077 |
1077 if (ngx_delete_file(name) == NGX_FILE_ERROR) { | 1078 if (ngx_delete_file(name) == NGX_FILE_ERROR) { |
1078 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, | 1079 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, |