Opened 4 years ago
Closed 4 years ago
#1683 closed defect (invalid)
ngx_parent in ngx_daemon() can not work properly?
|Reported by:||Owned by:|
|nginx -V:||nginx version: nginx/1.15.6|
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?
Change History (1)
comment:1 by , 4 years ago
|Status:||new → closed|
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.