diff src/core/nginx.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 69f9ee0342db
children fdd6a070d518
line wrap: on
line diff
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -228,6 +228,7 @@ main(int argc, char *const *argv)
 #endif
 
     ngx_pid = ngx_getpid();
+    ngx_parent = ngx_getppid();
 
     log = ngx_log_init(ngx_prefix);
     if (log == NULL) {