supervisor

安装

yum install epel-release
yum install -y supervisor

  

默认配置文件:/etc/supervisord.conf
进程管理配置文件放到:/etc/supervisord.d/目录下便可git

进程配置文件以下实例:github

[program:test-server]
process_name=%(program_name)s
command = /home/
directory = /home/test-server
autostart = true
startsecs = 5
autorestart = true
startretries = 3
user = root
redirect_stderr = true
stdout_logfile_maxbytes = 20MB
stdout_logfile_backups = 10
stdout_logfile = /var/log/test-server.log

  

使用

supervisorctr restart start stop 等等post

--------------------- 本文来自 Go哥 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/suiban7403/article/details/80199097?utm_source=copy ui

配置Supervisor开机启动:

新建一个“supervisord.service”文件.net

# dservice for systemd (CentOS 7.0+) 
# by ET-CS (https://github.com/ET-CS) 
[Unit] 
Description=Supervisor daemon

[Service] 
Type=forking 
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf 
ExecStop=/usr/bin/supervisorctl shutdown 
ExecReload=/usr/bin/supervisorctl reload 
KillMode=process 
Restart=on-failure 
RestartSec=42s

[Install] 
WantedBy=multi-user.target

  

将文件拷贝至:“/usr/lib/systemd/system/supervisord.service”unix

systemctl enable supervisord

clip_image001

验证一下是否为开机启动:rest

systemctl is-enabled supervisord

clip_image002

 

 

问题1 :unix:///tmp/supervisor.sock no such filecode

问题1 :Can't drop privilege as nonroot userserver

运行命令:blog

 

supervisorctl shutdown

 

相关文章
相关标签/搜索