centos【rockylinux】安装【supervisor】的注意事项【完整版】

重新加载 systemd 配置推荐使用pip的方式安装

bash 复制代码
pip install supervisor

第二步:添加supervisord.conf配置文件

bash 复制代码
[unix_http_server]
file=/tmp/supervisor.sock   ; UNIX socket 文件,supervisorctl 会使用
;chmod=0700                 ; socket 文件的 mode,默认是 0700
;chown=nobody:nogroup       ; socket 文件的 owner,格式: uid:gid

; [inet_http_server]         ; HTTP 服务器,提供 web 管理界面
; port=0.0.0.0:8080        ; Web 管理后台运行的 IP 和端口,如果开放到公网,需要注意安全性
; username=root              ; 登录管理后台的用户名
; password=1123               ; 登录管理后台的密码

[supervisord]
logfile=/tmp/supervisord.log ; 日志文件,默认是 $CWD/supervisord.log
logfile_maxbytes=50MB        ; 日志文件大小,超出会 rotate,默认 50MB
logfile_backups=10           ; 日志文件保留备份数量默认 10
loglevel=info                ; 日志级别,默认 info,其它: debug,warn,trace
pidfile=/tmp/supervisord.pid ; pid 文件
nodaemon=false               ; 是否在前台启动,默认是 false,即以 daemon 的方式启动
minfds=1024                  ; 可以打开的文件描述符的最小值,默认 1024
minprocs=200                 ; 可以打开的进程数的最小值,默认 200

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; 通过 UNIX socket 连接 supervisord,路径与 unix_http_server 部分的 file 一致
; serverurl=http://127.0.0.1:8080 ; 通过 HTTP 的方式连接 supervisord

; 包含其他的配置文件【可以是 *.conf 或 *.ini】
[include]
files = /etc/supervisor/*.conf /etc/supervisor/common/*.conf

第三步:配置 supervisord.service文件

手动创建 supervisord.service

如果 supervisord.service 不存在,你可以手动创建:

bash 复制代码
vim /etc/systemd/system/supervisord.service
bash 复制代码
# supervisord service for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon

[Service]
Type=forking
ExecStart=/usr/local/anaconda3/bin/supervisord
ExecStop=/usr/local/anaconda3/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/local/anaconda3/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

重新加载 systemd 配置

bash 复制代码
sudo systemctl daemon-reload

最后tab补全支持【】

bash 复制代码
 yum install bash-completion
bash 复制代码
启用 Bash 补全
确保 Bash 补全已启用。在 ~/.bashrc 或 /etc/bash.bashrc 中添加以下内容:


if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
fi
然后重新加载 Bash 配置:


source ~/.bashrc

最后执行 systemctl restart supervisord.service 补全试试

相关推荐
十巷无终4 分钟前
Kali Virtual Machines(虚拟机镜像)安装后问题及解决办法
linux·运维·服务器
赵民勇6 分钟前
gtkmm库之GtkWindow与ApplicationWindow用法详解
linux·c++
BestOrNothing_201519 分钟前
(4)Ubuntu 22.04 安装后使用 GParted 重新分区实战记录
linux·gparted·ubuntu22.04·ubuntu磁盘分区
架构指南20 分钟前
Centos上安装Claude Code报GLIBC_2.27 not found
linux·运维·centos
Predestination王瀞潞25 分钟前
4.3.1 存储->微软文件系统标准(微软,自有技术标准):exFAT(Extended File Allocation Table)扩展文件分配表系统
linux·运维·microsoft·exfat·ex4
你有按下913的勇气吗28 分钟前
【Agent,RAG,Transform】
linux·运维·服务器
ken223231 分钟前
linux OS : apt update 使用代理与环境变量
linux
last demo33 分钟前
docker存储
运维·docker·容器
小义_41 分钟前
随笔 1(Linux)
linux·运维·服务器·网络·云原生·红帽
Larry_Yanan1 小时前
Qt网络开发之基于 QWebEngine 实现简易内嵌浏览器
linux·开发语言·网络·c++·笔记·qt·学习