Opened 7 years ago
Closed 7 years ago
#1683 closed defect (invalid)
ngx_parent in ngx_daemon() can not work properly?
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | nginx-core | Version: | 1.15.x |
| Keywords: | Cc: | ||
| uname -a: | |||
| nginx -V: | nginx version: nginx/1.15.6 | ||
Description
In function ngx_daemon(), after fork the child would run
ngx_parent = ngx_pid;
But the parent process will call exit(0) and terminate, so the init process will be the parent of the master process, cause the var ngx_parent to be nonsense.
Should we call get_ppid() in ngx_master_process_cycle() to get the proper parent?
Thanks.
Note:
See TracTickets
for help on using tickets.

The ngx_parent variable is expected to contain PID or original parent process, and used to check if parent process is already exited or not.