2013-06-24 55 views
4

我正在尝试使用nginx的主管,但我还没有能够到达nginx部分,因为我正在与主管搞砸了一些事情。运行主管异常终止错误

我可以运行

sudo supervisorctl reread 

,它会说 “site_demo:可用”。然后我运行

sudo supervisorctl update 

它说“site_demo:更新的进程组”。这似乎很好。但后来我尝试运行

sudo supervisorctl start site_demo 

,我得到的错误

site_demo: ERROR (abnormal termination) 

这里是我的supervisor.conf文件:

; supervisor config file 

[unix_http_server] 
file=/var/run//supervisor.sock ; (the path to the socket file) 
chmod=0700      ; sockef file mode (default 0700) 

[supervisord] 
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) 
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 
childlogdir=/var/log/supervisor   ; ('AUTO' child log dir, default $TEMP) 

; the below section must remain in the config file for RPC 
; (supervisorctl/web interface) to work, additional interfaces may be 
; added by defining them in separate rpcinterface: sections 
[rpcinterface:supervisor] 
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 

[supervisorctl] 
serverurl=unix:///var/run//supervisor.sock ; use a unix:// URL for a unix socket 

; The [include] section can just contain the "files" setting. This 
; setting can list multiple files (separated by whitespace or 
; newlines). It can also contain wildcards. The filenames are 
; interpreted as relative to this file. Included files *cannot* 
; include files themselves. 

[include] 
files = /etc/supervisor/conf.d/*.conf 

这里是demo.conf,一个文件包含在[include]中:

[program:site_demo] 

directory=/home/snorthway/demo/website 

environment=PYTHONPATH=/home/snorthway/python-envs/demo 

command=/home/snorthway/python-envs/demo/bin/python /home/snorthway/demo/website/manage.py runfcgi method=prefork socket=/home/snorthway/eft/demo/fcgi/socket pidfile=/home/snorthway/eft/demo/fcgi/demo.pid minspare=4 maxspare=10 daemonize=false 

redirect_stderr=true 

stdout_logfile=/home/snorthway/eft/demo/logs/demo.fcgi.log 

autostart=true 

user=www-data 

我检查了那里的所有路径都存在,所以我不认为这是问题所在。

我的日志文件看起来像这样:

2013-06-24 15:40:23,548 CRIT Supervisor running as root (no user in config file) 
2013-06-24 15:40:23,566 INFO RPC interface 'supervisor' initialized 
2013-06-24 15:40:23,566 WARN cElementTree not installed, using slower XML parser for XML-RPC 
2013-06-24 15:40:23,566 CRIT Server 'unix_http_server' running without any HTTP authentication checking 
2013-06-24 15:40:23,566 INFO daemonizing the supervisord process 
2013-06-24 15:40:23,566 INFO supervisord started with pid 8896 
2013-06-24 16:08:27,262 INFO spawned: 'site_demo' with pid 9221 
2013-06-24 16:08:27,464 INFO exited: site_demo (exit status 0; not expected) 
2013-06-24 16:08:28,469 INFO spawned: 'site_demo' with pid 9226 
2013-06-24 16:08:28,667 INFO exited: site_demo (exit status 0; not expected) 
2013-06-24 16:08:30,672 INFO spawned: 'site_demo' with pid 9231 
2013-06-24 16:08:30,863 INFO exited: site_demo (exit status 0; not expected) 
2013-06-24 16:08:33,870 INFO spawned: 'site_demo' with pid 9240 
2013-06-24 16:08:34,077 INFO exited: site_demo (exit status 0; not expected) 
2013-06-24 16:08:35,079 INFO gave up: site_demo entered FATAL state, too many start retries too quickly 

回答

4

好吧,如果我看着demo.fcgi.log我会很久以前想通了这一点。它完全由这个错误的:

ERROR: No module named flup 
    Unable to load the flup package. In order to run django 
    as a FastCGI application, you will need to get flup from 
    http://www.saddi.com/software/flup/ If you've already 
    installed flup, then make sure you have it in your PYTHONPATH. 

所以我做

pip install flup 
sudo supervisorctl reread # This may not have been necessary 
sudo supervisorctl update 
sudo supervisorctl start site_demo 

和它的工作!

+0

嗨,这个demo.fcgi.log位于哪里?我试图检查类似的东西,但无法找到该日志 – vabada

+1

嗨@dabad,无论你在你的管理员配置文件中设置了“stdout_logfile”。如果你看问题,我在'demo.conf'中设置我的地址。如果你没有设置'stdout_logfile',默认情况下是'$ CWD/supervisord.log'(参见http://supervisord.org/logging.html)。祝你好运! – snorthway