Flask app on uwsgi/nginx - unix socket file is not created on booting

社会主义新天地 提交于 2019-12-01 06:55:55

The main issue seems to be from the uwsgi service; it just doesn't work.

I found another way to start uwsgi at startup: upstart and uwsgi --emperor from http://uwsgi-docs.readthedocs.org/en/latest/Upstart.html and http://upstart.ubuntu.com

The process is just make a flask.conf file in /etc/init directory. uwsgi --emperor controls all the ini files in the uwsgi directory.

# simple uWSGI script
# http://uwsgi-docs.readthedocs.org/en/latest/Upstart.html

description "uwsgi tiny instance"
start on runlevel [2345]
stop on runlevel [06]

respawn

exec uwsgi --emperor /etc/uwsgi/apps-enabled

I also had to sudo update-rc.d uwsgi disable so that uwsgi service should be disabled.

I also found this site http://flaviusim.com/blog/Deploying-Flask-with-nginx-uWSGI-and-Supervisor/ for invoking uswgi at startup, but I didn't test it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!