Welcome! Log In Create A New Profile

Advanced

Re: Worker process is not getting killed , when master is killed using -9

Phil Pennock
August 08, 2013 02:52PM
On 2013-08-08 at 06:29 +0000, Vivek Goel wrote:
> I am facing one problem with nginx. I am waiting for nginx to stop withing
> 30 seconds. If it is not getting stopped, I am firing command to kill
> master process using
> pkill -9 <master_process_pid>
>
> But, Killing master is not killing the worker process. Due to that reason.
> Port is not getting released.
>
> Is it known problem or desired behavior ?

Fundamental Unix: the process never gets a chance to kill the children
when you use -9.

Instead, you want to use `pkill ... -g <master_process_pid>`.

The -g says to use the "process group"; you can send a signal to all
processes in a group [killpg(2)] and the nginx worker processes are part
of the same process group as the nginx master process, which is the
process group leader (so its pid is the pgid of all the processes you
care about).

Do please try to use -TERM once with the process-group kill, to give the
workers a chance to clean up safely, before you hit all of the processes
at once with the nuclear option.

Regards,
-Phil

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Worker process is not getting killed , when master is killed using -9

goelvivek August 08, 2013 02:30AM

Re: Worker process is not getting killed , when master is killed using -9

cubicdaiya August 08, 2013 02:54AM

Re: Worker process is not getting killed , when master is killed using -9

goelviek2011@gmail.com August 10, 2013 06:31AM

Re: Worker process is not getting killed , when master is killed using -9

Phil Pennock August 08, 2013 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 308
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready