2017-02-20 173 views
1

我已经在Ubuntu 12.04上设置了一个uwsgi服务。uwsgi启动失败,但不记录任何错误

这里是我使用的自定义配置文件:

[uwsgi] 
# this is the path to the virtualenv 
home = /var/www/api/webservice/current/ 

# this will point to the same file 
paste = config:/var/www/api/webservice/production.ini 

socket = /tmp/my_api.socket 
gid = www-data 
uid = www-data 
logdate = true 
master = true 
harakiri = 30 
limit-as = 1536 
reload-on-as = 1200 
no-orphans = true 
log-x-forwarded-for = true 
threads = 15 
workers = 2 
stats = /tmp/my_api_stats.socket 
listen = 400 

当我运行sudo service uwsgi start我碰到一个“失败”。 但是/var/log/uwsgi/app/my_api.log中的日志不显示任何错误消息。

我该如何调试?

回答

2

作为调试步骤,您可以从服务的/ etc/systemd/system单元配置中检查您的ExecStart命令。尝试运行该命令并查看是否有关于该错误的更多信息。

顺便说一下,你确定你的日志文件/var/log/uwsgi/app/my_api.log是日志文件写入的日志文件吗?当然,这可能是默认的,但如果不是这样,你应该在你的配置中有logto=/path/to/the/log选项。

1

也许uwsgi --ini this_config_file.ini会帮你调试吗?

1

如果您使用的是基于Debian的Linux操作系统,您会在/ var/log/uwsgi/app/log中找到默认的应用程序日志。

我也很难在调试uwsgi服务启动失败的原因。 对我来说uwsgi --ini this_config_file.ini工作正常,但service uwsgi start失败,没有提供太多的信息。