diff 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
line wrap: on
line diff
--- a/src/os/unix/ngx_process.h
+++ b/src/os/unix/ngx_process.h
@@ -54,6 +54,7 @@ typedef struct {
 
 
 #define ngx_getpid   getpid
+#define ngx_getppid  getppid
 
 #ifndef ngx_log_pid
 #define ngx_log_pid  ngx_pid
@@ -79,6 +80,7 @@ extern char         **ngx_argv;
 extern char         **ngx_os_argv;
 
 extern ngx_pid_t      ngx_pid;
+extern ngx_pid_t      ngx_parent;
 extern ngx_socket_t   ngx_channel;
 extern ngx_int_t      ngx_process_slot;
 extern ngx_int_t      ngx_last_process;