【原创】Linux基础之supervisor

简介

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.
官网:http://supervisord.org

安装

yum install supervisor

配置

配置文件路径

/etc/supervisord.d/*.ini

配置文件示例

/etc/supervisord.d/mypro.ini

[program:mypro]
environment=JAVA_HOME="/usr/java/jdk1.8.0_202-amd64"
directory=/path/to/mypro
command=sh /path/to/mypro/start.sh
autostart=true
autorestart=true
user=root
numprocs=1
startretries=3
stopasgroup=true
killasgroup=true
startsecs=5
stderr_logfile=/path/to/mypro/stderr.log
stdout_logfile=/path/to/mypro/stdout.log

可配置环境变量、启动命令、启动用户、日志目录等

启动

systemctl start supervisord.service
systemctl enable supervisord.service

使用

supervisorctl status
supervisorctl start
supervisorctl stop
supervisorctl restart
supervisorctl update
supervisorctl reload


---------------------------------------------------------------- 结束啦,我是大魔王先生的分割线 :) ----------------------------------------------------------------
  • 由于大魔王先生能力有限,文中可能存在错误,欢迎指正、补充!
  • 感谢您的阅读,如果文章对您有用,那么请为大魔王先生轻轻点个赞,ありがとう
原文地址:https://www.cnblogs.com/barneywill/p/15206202.html