如何使用supervisor启动/停止uWSGI应用程序?

Bdf*_*dfy 18 uwsgi supervisord

我使用主管来运行uWSGI应用程序.为什么uWSGI应用程序在停止主管后并不总是停止?主管配置:

[program:test]
autostart = true
user=root
command=uwsgi --master --workers  5 --disable-logging --socket 127.0.0.1:8888
--module web --callable app
priority=1
redirect_stderr=true
stdout_logfile = /data/log
Run Code Online (Sandbox Code Playgroud)

rob*_*rto 38

默认情况下,主管在停止时发送SIGTERM.uWSGI中的SIGTERM意味着"残酷的重装".

您必须将其更改为QUIT或INT:

stopsignal = QUIT

应该够了

另一种方法(不鼓励)是在uWSGI命令行中添加--die-on-term以更改其默认行为

  • 我对这两种方法都没有什么经验,但是当我在寻找合适的配置时,我发现了一些问题的例子,这些问题显然只能通过使用`die-on-term`来解决,例如http://stackoverflow.com/a/ 22213404/202168 https://github.com/unbit/uwsgi/issues/296 (2认同)