rockylinux/rockylinux:9
/usr/local/supervisor/supervisord -c /etc/supervisord/supervisord.conf
ochinchina/supervisord 一个 Golang 语言编写的进程守护工具
配置文件路径
[root@1b25435de80b supervisor]# cat /etc/supervisord/
conf.d/ supervisord.conf
[root@1b25435de80b supervisor]# cat /etc/supervisord/supervisord.conf
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ;(main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ;(supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
logfile_maxbytes=50MB ;日志文件大小,超出会rotate,默认 50MB,如果设成0,表示不限制大小
logfile_backups=10 ;日志文件保留备份数量默认10,设为0表示不备份
loglevel=info ;日志级别,默认info,其它: debug,warn,trace
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:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[inet_http_server]
port=0.0.0.0:9001
[include]
files = /etc/supervisord/conf.d/*.conf
安装了 open-sshd 服务,默认端口 22。默认用户 root 密码 rockylinux,可以自己通过 passwd 命令修改,已经开启了允许 root 的远程登录。通过 supervisord 进行管理启动
supervisord 的管理配置文件
# cat /etc/supervisord/conf.d/sshd.conf
[supervisord]
nodaemon=true
logfile=/var/log/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/var/run/supervisord.pid
umask=022
identifier=supervisor
[program:sshd]
# 启动 sshd 的命令,-D 表示以非守护进程模式运行(便于 supervisord 管理)
command=/usr/sbin/sshd -D
# 自动启动
autostart=true
# 程序退出后自动重启
autorestart=true
# 启动重试次数
startretries=3
# 启动超时时间(秒)
startsecs=5
# 停止信号
stopsignal=TERM
# 停止等待时间(秒)
stopwaitsecs=10
# 重定向 stdout 到指定日志文件
stdout_logfile=/var/log/sshd.stdout.log
# 日志文件大小限制
stdout_logfile_maxbytes=10MB
# 日志文件备份数量
stdout_logfile_backups=3
# 重定向 stderr 到指定日志文件
stderr_logfile=/var/log/sshd.stderr.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=3
# 以 root 用户运行(sshd 需要 root 权限)
user=root
Content type
Image
Digest
sha256:2f23cf478…
Size
135 MB
Last updated
about 1 year ago
docker pull wangyanglinux/rockylinux:supervisord-sshd