当前位置: 首页 > 后端技术 > Python

[supervisor]遇到的两个问题

时间:2023-03-25 22:45:27 Python

问题1rejectedconnection问题现象$supervisorctl-c/root/ppe-detection/supervisord.confunix:///root/supervisor.sockrejectedconnection原因分析supervisor主要包括2个组件(其实还有areothers):supervisord主进程,负责管理进程的服务器,它会根据配置文件创建应用指定数量的子进程,管理子进程的整个生命周期,重启崩溃进程,和processChanges发送事件通知等。supervisorctl客户端的命令行工具提供了一个类似shell的操作界面。每次使用supervisorctl时,都需要确保supervisord正常运行。Solution#1.需要把之前打开的supervisor全部杀掉,先查看supervisor(本身也是基于python的)及其运行的python进程$psaux|greppython#kill可以使用下面的命令结合supervisor并杀死所有正在运行的python进程$ps-ef|蟒蛇|grep-vgrep|awk'{print$2}'|xargskill-9#2.重启supervisord$sudosupervisord-csupervisord.conf#3.如果没有报错,可以使用supervisorctl$supervisorctlproblem2unlinkingstalesocket问题现象$sudosupervisord-csupervisord.confUnlinkingstalesocket/{some_dir}/supervisor.sock问题分析上面说是unlinkingtheoldsocket,所以直接helpitremove就可以了。问题解决$sudosupervisord-csupervisord.confUnlinkingstalesocket/{some_dir}/supervisor.sock#使用unlink命令复制上面supervisor.sock的路径$unlilnk/{some_dir}/supervisor.sock#然后就可以了通常使用$sudosupervisord-csupervisord.conf$supervisorctlreferencesupervisor原理以及如何在linux下使用3种高效杀掉所有python进程的方法(包括写一个runningscript.sh)