1.安装命令
pip3 install -i https://pypi.douban.com/simple supervisor
2.创建supervisor的配置文件
echo_supervisord_conf > /etc/supervisor.conf
3.编辑配置文件,写入管理nbcrm的任务参数
[program:s20nbcrm]
command=/root/Envs/nbcrm/bin/uwsgi --ini uwsgi.ini
stopasgroup=true ;默认为false,进程被杀死时,是否向这个进程组发送stop信号,包括子进程
killasgroup=true ;默认为false,向进程组发送kill信号,包括子进程
4.启动supervisor,去管理uwsgi
supervisord -c /etc/supervisor.conf
#指定配置文件,启动这个服务
5.通过supervisorctl管理命令,管理uwsgi
supervisorctl -c /etc/supervisor.conf
命令如下
status all
start s20nbcrm
stop s20nbcrm
stop all