centos7.7 安装指定版本的supervisor
# 运行程序报错
/usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -u apache
[root@eus_influenex_web01:/usr/local/php]# /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -u apache
/usr/lib/python2.7/site-packages/supervisor/options.py:383: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
return pkg_resources.EntryPoint.parse("x="+spec).load(False)
# 需要安装supervisor 3.2 以上的版本,删除原有版本 rpm -e supervisor3.1.4
# 安装依赖
yum install -y python-pip
cd /usr/lib/python2.7/site-packages/
wget https://github.com/Supervisor/supervisor/archive/3.3.5.tar.gz
tar xf 3.3.5.tar.gz
cd supervisor-3.3.5/
# 发现/usr/bin/supervisord的版本还是3.1.4,删除这个可执行程序,重新运行安装即可
python setup.py install
安装的时候报警处理方式
[root@eus_influenex_web03:~]# cat /usr/lib/python2.7/site-packages/pkg_resources/py2_warn.py
import sys
import warnings
import textwrap
msg = textwrap.dedent("""
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
""")
pre = "Setuptools will stop working on Python 2\n"
# 注释掉这行
#sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
# 添加systemd管理进程的配置
# 修改supervisord的配置
# vim /etc/supervisord.conf
nodaemon=false
修改为
nodaemon=true
# vim /etc/systemd/system/supervisord.service
[Unit] Description=Supervisor daemon [Service] ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown ExecReload=/usr/bin/supervisorctl $OPTIONS reload KillMode=process Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target
通过systemctl管理supervisor程序
# vim /etc/systemd/system/supervisor.service
# supervisord service for systemd (CentOS 7.0+) # [Unit] Description=Supervisor daemon [Service] Type=forking LimitNOFILE=655350 LimitNPROC=655350 ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf ExecStop=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf shutdown ExecReload=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf reload KillMode=process Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2017-02-06 Windows2008 r2 x64下安装FTP工具File Zilla server报错:could not load tls libraries filezilla