diff options
Diffstat (limited to 'src/os/unix/ngx_daemon.c')
-rw-r--r-- | src/os/unix/ngx_daemon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c index b2a37c100..8bad5444a 100644 --- a/src/os/unix/ngx_daemon.c +++ b/src/os/unix/ngx_daemon.c @@ -19,6 +19,8 @@ int ngx_daemon(ngx_log_t *log) exit(0); } + ngx_pid = ngx_getpid(); + if (setsid() == -1) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "setsid() failed"); return NGX_ERROR; |