1、supervisor守护进程
supervisor离线安装
pip install setuptools-57.4.0-py3-none-any.whl pip install meld3-2.0.1-py2.py3-none-any.whl pip install supervisor-4.2.2-py2.py3-none-any.whl
supervisor 工程部署
mkdir /etc/supervisor echo_supervisord_conf > /etc/supervisor/supervisord.conf vim /etc/supervisor/supervisord.conf 在/etc/supervisord.conf末尾添加 [program:empi_recommend] command=python /data0/htdocs/chat/main.py priority=1 numprocs=1 autostart=true autorestart=true supervisor常用命令 supervisord 启动 supervisorctl status 查看状态 supervisorctl update 更新配置 supervisorctl stop empi_recommend 停止某个进程 supervisorctl start empi_recommend 启动某个进程 supervisorctl restart program_name 重启某个进程 supervisorctl stop all 关闭所有进程 supervisorctl reload 重新启动配置中的所有程序 supervisorctl update 根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启
2、pyinstaller