diff src/os/unix/ngx_process_cycle.c @ 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 d45072375572
children 84e53e4735a4
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -31,6 +31,7 @@ static void ngx_cache_loader_process_han
 ngx_uint_t    ngx_process;
 ngx_uint_t    ngx_worker;
 ngx_pid_t     ngx_pid;
+ngx_pid_t     ngx_parent;
 
 sig_atomic_t  ngx_reap;
 sig_atomic_t  ngx_sigio;