讓主管運行我的龍捲風應用程序時遇到了一些問題。Supervisord,Flask,Tornado(退出狀態1;未預期)
我有一個使用Flask構建的REST API,使用Tornado來嘗試並提供它。我遇到的問題是,當我嘗試與管理員一起運行時,它似乎無法導入其他支持python軟件包。
inf_api是燒瓶API。
這裏是龍捲風腳本
from influence_api import app
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.options import define, options
define("port", default=8080, help="Port to listen on", type=int)
if __name__ == '__main__':
options.parse_command_line()
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(options.port)
IOLoop.instance().start()
的supervisord.conf的程序部分(我試過的幾個迭代)
[program:tornado-8080]
autostart=true
autorestart=true
environment=USER=root,PYTHONPATH=/usr/bin/
command=python /media/sf_Projects/inf_api/inf_api/inf_server_nginx.py
stderr_logfile = /var/log/supervisord/tornado-stderr.log
stdout_logfile = /var/log/supervisord/tornado-stdout.log
伊夫試圖用多少放玩弄在環境中以及直接放置在命令中的數量。包括主管
2014-02-25 16:55:24,917 INFO spawned: 'tornado-8080' with pid 3527
2014-02-25 16:55:25,156 DEBG 'tornado-8080' stderr output:
Traceback (most recent call last):
File "/media/sf_Projects/inf_api/inf_api/inf_server_nginx.py", line 11, in <module>
2014-02-25 16:55:25,157 DEBG 'tornado-8080' stderr output:
from inf_api import app
2014-02-25 16:55:25,157 DEBG 'tornado-8080' stderr output:
File "/media/sf_Projects/inf_api/inf_api/inf_api.py", line 159, in <module>
2014-02-25 16:55:25,158 DEBG 'tornado-8080' stderr output:
mongo_ip = read_config('Database')['mongoip']
2014-02-25 16:55:25,158 DEBG 'tornado-8080' stderr output:
File "/media/sf_Projects/inf_api/inf_api/inf_api.py", line 114, in read_config
2014-02-25 16:55:25,158 DEBG 'tornado-8080' stderr output:
options = config.options(section)
2014-02-25 16:55:25,159 DEBG 'tornado-8080' stderr output:
File "/usr/lib/python2.7/ConfigParser.py", line 279, in options
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'Database'
.........
2014-02-25 20:29:26,924 INFO exited: tornado-8080 (exit status 1; not expected)
運行龍捲風如帶或不帶SSL變化.....一樣
user=root
autostart=true
autorestart=true
exitcodes=0,1,2
command=env PATH="/usr/bin/python" /media/sf_Projects/inf_api/inf_api/inf_server_nginx.py --port=8081
command=/usr/bin/python /media/sf_Projects/inf_api/inf_api/inf_nginx.py --port=8081
stderr_logfile = /var/log/supervisord/tornado-stderr.log
stdout_logfile = /var/log/supervisord/tornado-stdout.log
錯誤輸出並在瓶API獨立工作得很好。冉監督與sudo和沒有....
正如你可以看到我難住 - 任何想法?
我給它一個鏡頭。我使用-n選項運行supervisord,當我對配置文件進行更改時(如註釋掉其他3個程序),更新將會更新。 supervisord.conf是在/ etc/ – Michael
更新 - 雅沒有變化 – Michael