centos 7 通过supervisor托管服务

1、安装supervisor

yum install -y supervisor

2、安装完之后默认加载其他配置文件的目录为

# tail /etc/supervisord.conf
;priority=999                  ; the relative start priority (default 999)

; 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.

[include]
files = supervisord.d/*.ini

3、配置服务

vim /etc/supervisord.d/myservice.ini
command     = /bin/t.sh
directory   = /tmp
user        = test
startsecs   = 3

redirect_stderr         = true
stdout_logfile_maxbytes = 50MB
stdout_logfile_backups  = 10
stdout_logfile          = /var/log/test.log

4、启动supervisord服务

supervisord -c /etc/supervisord.conf 

 

5、通过supervisorctl操作服务

# supervisorctl
myservice                  RUNNING   pid 53913, uptime 0:00:49

 

posted @ 2020-08-26 19:40  西橙  阅读(232)  评论(0编辑  收藏  举报