Opened 6 years ago

Closed 6 years ago

#1683 closed defect (invalid)

ngx_parent in ngx_daemon() can not work properly?

Reported by: chronolaw@… 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.

Change History (1)

comment:1 by Maxim Dounin, 6 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.