Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signal_graceful_exit just set a flag for graceful exit? #112

Closed
spacewander opened this issue May 15, 2017 · 2 comments
Closed

signal_graceful_exit just set a flag for graceful exit? #112

spacewander opened this issue May 15, 2017 · 2 comments

Comments

@spacewander
Copy link
Member

It seems that signal_graceful_exit only set the ngx_quit instead of triggering a real graceful exit...

Refer from the Nginx source:

sigsuspend(&set);
...
if (ngx_quit) {

I guess that if a graceful exit is in need, it is required to send a signal to resume master process after sigsuspend.

Maybe I am missing something.

@agentzh
Copy link
Member

agentzh commented May 15, 2017

@spacewander It only works for the current nginx process, as stated in the nginx documentation. A worker can not usually send a signal to master, for example, since a worker usually does not have enough permissions to do so. This feature is mostly for an nginx worker to voluntarily gracefully shut down itself.

@agentzh agentzh closed this as completed May 15, 2017
@agentzh
Copy link
Member

agentzh commented May 15, 2017

@spacewander If you want to send signals to nginx master from within the same nginx daemon, then you should use the new "privileged agent" process feature instead in OpenResty:

https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/process.md#enable_privileged_agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants