Mercurial > hg > nginx
comparison src/os/unix/ngx_process.h @ 7162:8b84d60ef13d
Fixed "changing binary" when reaper is not init.
On some systems, it's possible that reaper of orphaned processes is
set to something other than "init" process. On such systems, the
changing binary procedure did not work.
The fix is to check if PPID has changed, instead of assuming it's
always 1 for orphaned processes.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 28 Nov 2017 12:00:24 +0300 |
parents | f31162fefe01 |
children |
comparison
equal
deleted
inserted
replaced
7161:325b3042edd6 | 7162:8b84d60ef13d |
---|---|
52 #define NGX_PROCESS_JUST_RESPAWN -4 | 52 #define NGX_PROCESS_JUST_RESPAWN -4 |
53 #define NGX_PROCESS_DETACHED -5 | 53 #define NGX_PROCESS_DETACHED -5 |
54 | 54 |
55 | 55 |
56 #define ngx_getpid getpid | 56 #define ngx_getpid getpid |
57 #define ngx_getppid getppid | |
57 | 58 |
58 #ifndef ngx_log_pid | 59 #ifndef ngx_log_pid |
59 #define ngx_log_pid ngx_pid | 60 #define ngx_log_pid ngx_pid |
60 #endif | 61 #endif |
61 | 62 |
77 extern int ngx_argc; | 78 extern int ngx_argc; |
78 extern char **ngx_argv; | 79 extern char **ngx_argv; |
79 extern char **ngx_os_argv; | 80 extern char **ngx_os_argv; |
80 | 81 |
81 extern ngx_pid_t ngx_pid; | 82 extern ngx_pid_t ngx_pid; |
83 extern ngx_pid_t ngx_parent; | |
82 extern ngx_socket_t ngx_channel; | 84 extern ngx_socket_t ngx_channel; |
83 extern ngx_int_t ngx_process_slot; | 85 extern ngx_int_t ngx_process_slot; |
84 extern ngx_int_t ngx_last_process; | 86 extern ngx_int_t ngx_last_process; |
85 extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; | 87 extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; |
86 | 88 |