我想從頭開始在服務器上安裝一個新的django項目(django + gunicorn + nginx),並且除了gunicorn的init腳本之外,gunicorn狀態是活動(退出),但顯示沒有在監控中運行
如果我手動運行該命令gunicorn它的工作,我可以對IP地址查看我的網站,但是當我嘗試做service gunicorn start
它給了我這樣的輸出,它不工作...
gunicorn-project.service
Loaded: loaded (/etc/init.d/gunicorn-project; bad; vendor preset: enabled)
Active: active (exited) since Thu 2016-11-17 04:23:56 UTC; 17min ago
Docs: man:systemd-sysv-generator(8)
Process: 1656 ExecStart=/etc/init.d/gunicorn-project start (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
Nov 17 04:23:56 project gunicorn-project[1656]: from multiprocessing import cpu_count
Nov 17 04:23:56 project gunicorn-project[1656]: /etc/gunicorn.d/gunicorn-project2.py:3: RuntimeWarning: Parent module '/
Nov 17 04:23:56 project gunicorn-project[1656]: from os import environ
Nov 17 04:23:56 project gunicorn-project[1656]: /etc/gunicorn.d/gunicorn-project3.py:2: RuntimeWarning: Parent module '
Nov 17 04:23:56 project gunicorn-project[1656]: from multiprocessing import cpu_count
Nov 17 04:23:56 project gunicorn-project[1656]: /etc/gunicorn.d/gunicorn-project3.py:3: RuntimeWarning: Parent module '
Nov 17 04:23:56 project gunicorn-project[1656]: from os import environ
Nov 17 04:23:56 project gunicorn-project[1656]: *
Nov 17 04:23:56 project systemd[1]: Started gunicorn-project.service.
Nov 17 04:25:01 project systemd[1]: Started gunicorn-project.service.
我想不通爲什麼會這樣......這是在輸出的文件引用...
"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ
def max_workers():
return cpu_count() * 2 + 1
max_requests = 1000
worker_class = 'gevent'
workers = max_workers()
errorlog = '/home/gunicorn-project/log/gunicorn/error.log'
accesslog = '/home/gunicorn-project/log/gunicorn/access.log'