补充【第二章】supervisor守护进程保障服务
编辑uwsgi.ini文件
[uwsgi] http = 0.0.0.0:8000 chdir = /home/ubuntu/NewsBox/NewsBox_web wsgi-file = /home/ubuntu/NewsBox/NewsBox_web/NewsBox_web/wsgi.py processes = 2 #static-map = /static=/home/ubuntu/simpleblog/static
配置supervisor配置文件/etc/supervisor/supervisord.conf,添加如下配置
[include] files = /etc/supervisor/conf.d/*.conf
在/etc/supervisor/conf.d/文件夹下添加配置文件xxx.conf
[program:NewsBox] command=sudo /home/ubuntu/venv35_1/bin/uwsgi --ini /home/ubuntu/NewsBox.ini autostart=true autorestart=true startsecs=5 priority=1 stopasgroup=true killasgroup=true
切记,如已有服务启动,记得更新supervisor服务!!!
sudo supervisorctl update