-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add "die-on-term" to fix uWSGI shutdown #16043
Comments
I'm willing to provide the PR for this change. |
Writing this down here: With
With
Looks like I didn't spot any relevant commit diffs between uWSGI 2.0.23 (which latest |
Can I just say how utterly stupid that is since SIGTERM is also the default signal from |
This comment was marked as off-topic.
This comment was marked as off-topic.
Fun stuff. All yours @markkuleinio. Thanks for staying on top of these uWSGI items! |
FYI, lincolnloop/pyuwsgi-wheels#23 opened about the |
Change Type
Addition
Area
Installation/upgrade
Proposed Changes
When using "
systemctl stop netbox
", systemd sends SIGTERM to the process (see https://www.freedesktop.org/software/systemd/man/latest/systemd.kill.html#KillSignal=).However, as documented in https://uwsgi-docs.readthedocs.io/en/latest/Management.html#signals-for-controlling-uwsgi, for uWSGI the SIGTERM signal means:
= it is not a "stop" signal for uWSGI.
(... "this bad choice has been fixed in uWSGI 2.1" as mentioned by the maintainer in https://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html, but it is apparently not happening any time soon.)
Thus, I'm proposing adding
die-on-term = true
to be added in the NetBox-defaultuwsgi.ini
.That makes the default
systemctl
behavior to work with uWSGI as well, instead of changing the kill signal innetbox.service
, to keep it simplier for also Gunicorn use.With that addition NetBox shuts down correctly with "
systemctl stop netbox
":Note: With the current default configuration, "systemctl stop netbox" just happens to currently work, because:
= it tries to reload uWSGI but a module import error prevents that happening.
I don't currently know why that happens, I haven't used
pyuwsgi
before, and this module import problem does not occur withuwsgi
package. (But the "reload vs. stop" problem is still valid withuwsgi
as well, sodie-on-term = true
is needed anyway.)The text was updated successfully, but these errors were encountered: