如何在centos6上用python安装守护进程软件supervisor4.1.0
首先我们到这个网站去下载supervisor4.1.0源码安装包
https://pypi.org/simple/supervisor/
找到supervisor-4.1.0.tar.gz这个包,下载并把这两个包放到你所需要装的服务器里。
[[email protected] ~]# tar xzvf supervisor-4.1.0.tar.gz #解压包
[[email protected] ~]# cd supervisor-4.1.0 #进入目录
[[email protected] ~]# yum install -y epel-release # 在centos上安装epel源
[[email protected] ~]# yum install -y python34 python34-setuptools #安装所需要的python3和安装工具
[[email protected] ~]# python3 setup.py install #使用python3来安装
[[email protected] ~]# echo_supervisord_conf > /etc/supervisord.conf #创建supervisor 的配置文件
[[email protected] ~]# supervisord -c /etc/supervisord.conf #使用supervisor配置文件来启动
[[email protected] ~]# supervisorctl update #到这儿supervisor就已经安装成功了
[[email protected] ~]# supervisorctl start 《name》 #开始守护进程
[[email protected] ~]#
常用命令
supervisorctl stop name # 停止某一个进程,program_name 为 进程的名字
supervisorctl start name # 启动某个进程
supervisorctl restart name # 重启某个进程
supervisorctl stop groupworker: # 结束所有属于名为 groupworker 这个分组的进程 (start,restart 同理)
supervisorctl stop groupworker:name # 结束 groupworker:name这个进程 (start,restart 同理)
supervisorctl stop all # 停止全部进程,注:start、restartUnlinking stale socket /tmp/supervisor.sock
、stop 都不会载入最新的配置文件
supervisorctl reload # 载入最新的配置文件,停止原有进程并按新的配置启动、管理所有进程
supervisorctl update # 根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启