我跟着this tutorial兩次,但在第二臺運行它的機器上,我得到了一個監督者運行的gunicorn錯誤。當我告訴上司啓動gunicorn使用:Gunicorn Supervisor啓動錯誤
$ sudo supervisorctl start gunicorn
gunicorn: ERROR (abnormal termination)
的gunicorn_err.log重複這個:
Unknown command: 'run_gunicorn'
Type 'manage.py help' for usage.
監督員的配置是這樣的:
[program:gunicorn]
command=/home/ubuntu/.virtualenvs/<VIRTUALENV>/bin/python /home/ubuntu/<APPNAME>/manage.py run_gunicorn -w 4 -k gevent
directory=/home/ubuntu/<APPNAME>
user=www-data
autostart=true
autorestart=true
stdout_logfile = /var/log/supervisor/gunicorn.log
stderr_logfile = /var/log/supervisor/gunicorn_err.log
的gunicorn.log是空的。我已經嘗試將用戶更改爲ubuntu並在沒有virtualenv的情況下運行(我的'默認'python環境也準備好了,因爲它具有所有先決條件包。)我甚至嘗試刪除gunicorn中變量賦值之間的空格。 CONF 其實如果我手動運行:
$ /usr/bin/python /home/ubuntu/<APPNAME>/manage.py run_gunicorn -w 4 -k gevent
2013-01-22 19:20:33 [1231] [INFO] Starting gunicorn 0.17.2
2013-01-22 19:20:33 [1231] [INFO] Listening at: http://127.0.0.1:8000 (1231)
2013-01-22 19:20:33 [1231] [INFO] Using worker: gevent
2013-01-22 19:20:33 [1236] [INFO] Booting worker with pid: 1236
2013-01-22 19:20:33 [1237] [INFO] Booting worker with pid: 1237
2013-01-22 19:20:33 [1238] [INFO] Booting worker with pid: 1238
2013-01-22 19:20:33 [1239] [INFO] Booting worker with pid: 1239
而且同樣用的virtualenv蟒蛇運行:
$ /home/ubuntu/.virtualenvs/<VIRTUALENV>/bin/python /home/ubuntu/<APPNAME>/manage.py run_gunicorn -w 4 -k gevent
2013-01-22 19:21:53 [1246] [INFO] Starting gunicorn 0.17.2
2013-01-22 19:21:53 [1246] [INFO] Listening at: http://127.0.0.1:8000 (1246)
2013-01-22 19:21:53 [1246] [INFO] Using worker: gevent
2013-01-22 19:21:53 [1251] [INFO] Booting worker with pid: 1251
2013-01-22 19:21:53 [1252] [INFO] Booting worker with pid: 1252
2013-01-22 19:21:53 [1253] [INFO] Booting worker with pid: 1253
2013-01-22 19:21:53 [1254] [INFO] Booting worker with pid: 1254
這怎麼可能是上司發起gunicorn不能當我找到「run_gunicorn」命令可以運行它使用任何python環境,它的工作原理?是的'gunicorn'
,在INSTALLED_APPS