我是靠谱客的博主 虚拟春天,这篇文章主要介绍supervisor 后台启动服务supervisor,现在分享给大家,希望可以做个参考。

supervisor

Centos 7 版本安装

安装

# 添加epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

# 安装
yum install supervisor -y

配置

# 默认配置文件
/etc/supervisord.conf
# 打开后看最后行,指定自己要启动服务的配置文件路径
[include]
files = supervisord.d/*.ini

添加自己的服务

# cat dotnet.ini

[program:dotnet]
command=/data/dotnet/dotnet ApiDoc.Server.dll 
directory=/usr/swagger
autorestart=true
stderr_logfile=/usr/swagger/DotNetCoreWeb.err.log
stdout_logfile=/usr/swagger/DotNetCoreWeb.out.log 
environment=ASPNETCORE_ENVIRONMENT=Production 
user=root
stopsignal=INT
startsecs=1

参数解释:
program 服务名
command 调用的服务要写绝对路径。

报错处理:

can’t find command ‘dotnet’
command 里面写绝对路径即可。

最后

以上就是虚拟春天最近收集整理的关于supervisor 后台启动服务supervisor的全部内容,更多相关supervisor内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(116)

评论列表共有 0 条评论

立即
投稿
返回
顶部