From afad21917584e9b452ba33ce3485edde5615b859 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 28 Nov 2017 12:00:24 +0300 Subject: 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. --- src/os/unix/ngx_daemon.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/os/unix/ngx_daemon.c') diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c index ab6721108..385c49b6c 100644 --- a/src/os/unix/ngx_daemon.c +++ b/src/os/unix/ngx_daemon.c @@ -26,6 +26,7 @@ ngx_daemon(ngx_log_t *log) exit(0); } + ngx_parent = ngx_pid; ngx_pid = ngx_getpid(); if (setsid() == -1) { -- cgit v1.2.3