补充【第二章】supervisor守护进程保障服务

编辑uwsgi.ini文件web

[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,添加以下配置ubuntu

[include]
files = /etc/supervisor/conf.d/*.conf

 

在/etc/supervisor/conf.d/文件夹下添加配置文件xxx.confbash

[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服务!!!spa

sudo supervisorctl update
相关文章
相关标签/搜索