簡體   English   中英

Gunicorn upstart腳本無法啟動

[英]Gunicorn upstart script fails to start

我有使用https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14上的教程制作的新貴腳本-04 除了我不使用virtualenv,所以我只有'exec gunicorn'

description "Test Django project"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid userx
setgid www-data
chdir /home/mahsan/Documents/Test

exec gunicorn --workers 3 --bind unix:/home/userx/Documents/Test/Test.sock Test.wsgi:application

使用grep :init /var/log/syslog我發現了這一點:

Apr 2 15:31:24 backbox內核:[5296.877715] init:gunicorn主進程結束,重新生成Apr 2 15:31:24 backbox內核:[5296.991094] init:gunicorn主進程(4247)終止,狀態為1 Apr 2 15: 31:24 backbox內核:[5296.991133] init:gunicorn主進程結束,重新生成4月2日15:31:24 backbox內核:[5297.102330] init:gunicorn主進程(4249)終止,狀態為1 Apr 2 15:31:24 backbox內核:[5297.102359]初始化:gunicorn主進程結束,重新生成4月2日15:31:24 backbox內核:[5297.217514]初始化:gunicorn主進程(4251)終止,狀態為1 Apr 2 15:31:24 backbox內核:[5297.217528 ] init:gunicorn重新生成的速度太快,已停止Apr 2 15:40:04 backbox內核:[5817.334970] init:gunicorn主進程(4533)終止,狀態為1

但是,當我運行exec gunicorn --workers 3 --bind unix:/home/userx/Documents/Test/Test.sock Test.wsgi:application從manage.py所在的目錄啟動時,不會發生任何情況。 然后當我做ps ax | grep gunicorn ps ax | grep gunicorn我看到工露面。

知道我在這里做錯了嗎?

好的,只需要在/ tmp中保存.sock文件即可。 另外,如果其他任何人都有權提供靜態文件,則將顯示403錯誤,這只是向nginx授予文件權限。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM