J'ai suivi deux fois le this tutorial, mais sur la seconde machine sur laquelle je l'ai exécuté, j'ai reçu une erreur gunicorn du superviseur. Quand je dis superviseur au démarrage gunicorn en utilisant:Erreur de démarrage du superviseur Gunicorn
$ sudo supervisorctl start gunicorn
gunicorn: ERROR (abnormal termination)
Le gunicorn_err.log répète ceci:
Unknown command: 'run_gunicorn'
Type 'manage.py help' for usage.
La config superviseur ressemble:
[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
Le gunicorn.log est vide. J'ai essayé de changer l'utilisateur en ubuntu et de courir sans virtualenv (mon environnement python 'par défaut' est aussi prêt à fonctionner car il contient tous les paquets pré-requis.) J'ai même essayé de supprimer des espaces entre les assignations de variables dans gunicorn. conf en fait, si je lance manuellement:
$ /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
Et même avec la course python 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
Comment est-il possible que le superviseur initié gunicorn ne peut pas trouver la commande « run_gunicorn » quand je peut l'exécuter en utilisant n'importe quel environnement python et cela fonctionne? Et oui 'gunicorn'
, est dans le INSTALLED_APPS