2016-05-31 34 views
0

我希望能夠使用主管來監視和運行gunicorn服務器。Supervisord,Gunicorn(退出狀態127;預計不會)

當我運行:

/usr/bin/gunicorn app.wsgi:application -c config.conf 

它的工作原理。

但是,我的主管conf文件中完全相同的命令不起作用。任何解釋?

supervisor.conf

[supervisord] 
[group:app] 
programs=gunicorn_app 
[program:gunicorn_app] 
environment=PYTHONPATH=usr/bin 
command=/usr/bin/gunicorn app.wsgi:application -c gunicorn.conf.py 
directory=~/path/to/app 

autostart=true 
autorestart=true 

environment=LANG="en_US.UTF-8",LC_ALL="en_US.UTF-8",LC_LANG="en_US.UTF-8" 

我收到類似這樣的錯誤:

2016-05-31 22:53:34,786 INFO spawned: 'gunicorn_app' with pid 18763 
2016-05-31 22:53:34,789 INFO exited: gunicorn_app (exit status 127; not expected) 
2016-05-31 22:53:35,791 INFO spawned: 'gunicorn_app' with pid 18764 
2016-05-31 22:53:35,795 INFO exited: gunicorn_app (exit status 127; not expected) 
2016-05-31 22:53:37,798 INFO spawned: 'gunicorn_app' with pid 18765 
2016-05-31 22:53:37,802 INFO exited: gunicorn_app (exit status 127; not expected) 
2016-05-31 22:53:40,807 INFO spawned: 'gunicorn_app' with pid 18766 
2016-05-31 22:53:40,810 INFO exited: gunicorn_app (exit status 127; not expected) 

我明白,退出代碼127的意思是「找不到命令」,但我可以執行相同的指令在命令行上。

+0

你可以在你的命令中加入--debug並添加那個輸出。 –

回答

1

嘗試使用絕對路徑。 /home/path/to/app not〜/ path/to/app