Supervisor 无法正确停止 uwsgi

Supervisor 无法正确停止 uwsgi

Supervisor 可以启动 uwsgi,但是在停止 uwsgi 后,当我尝试再次启动它时出现此错误:

2014-03-16 08:38:34,249 DEBG 'app' stderr output:                                                                                      
thunder lock: disabled (you can enable it with --thunder-lock)                                                                         

2014-03-16 08:38:34,249 DEBG 'app' stderr output:                                                                                      
probably another instance of uWSGI is running on the same address (127.0.0.1:8001).                                                    

2014-03-16 08:38:34,249 DEBG 'app' stderr output:                                                                                      
bind(): Address already in use [core/socket.c line 759]                                                                                

2014-03-16 08:38:34,250 DEBG fd 11 closed, stopped monitoring <POutputDispatcher at 33121488 for <Subprocess at 32641104 with name app 
in state STARTING> (stdout)>                                                                                                           
2014-03-16 08:38:34,250 DEBG fd 15 closed, stopped monitoring <POutputDispatcher at 33122208 for <Subprocess at 32641104 with name app 
in state STARTING> (stderr)>                                                                                                           
2014-03-16 08:38:34,250 INFO exited: app (exit status 1; not expected)                                                                 
2014-03-16 08:38:34,250 DEBG received SIGCLD indicating a child quit                                                                   
2014-03-16 08:38:35,251 INFO gave up: app entered FATAL state, too many start retries too quickly 

似乎它没有正确停止 uwsgi,因为当它尝试重新启动它时会出现问题。我对 Supervisor 的 uwsgi 配置如下:

[program:uwsgi]
command=/usr/local/bin/uwsgi --ini /etc/conf/uwsgi_$APP.ini
user=uwsgi
autostart=true
autorestart=true
stderr_logfile=uwsgi_err.log
stdout_logfile=uwsgi_out.log
stopsignal=INT

我也尝试过 stopsignal=quit。我哪里做错了?

答案1

您需要提供uwsgi要停止的进程的 pidfile:http://uwsgi-docs.readthedocs.org/en/latest/Options.html#stop

相关内容