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

 

相關文章
相關標籤/搜索