2017-02-20 59 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失敗,沒有提供太多的信息。