linux net 进程,Linux与.Net Core(十) Supervisor进程守护安装

1.yum安装python依赖包

输入命令  yum install python-setuptools

58951614c089861af539f731ea7a9987.png

2.yum安装Supervisor

输入命令easy_install supervisor

4d4fa653a73bb2c59f2ec8d6cbd7426a.png

3.配置Supervisor

(1)在etc下创建目录,并赋予权限

b47fd464214d2cc5c0ca823a3ddf6666.png

输入命令  mkdir -m 700 -p /etc/supervisor

419bdb81f9a4b4c3705d3e6e1a760ba2.png

(2)在目录“/etc/supervisor“ 创建配置文件

9985eaea85d322a3691d53952425dc39.png

输入命令 echo_supervisord_conf > /etc/supervisor/supervisord.conf

8c3ce33baf883d8e28e029a3f9a1ec63.png

(3)修改配置文件

输入命令   vim /etc/supervisor/supervisord.conf

490072e53c7684af7333908240a51f9e.png

(4)在目录“/etc/supervisor”下创建.NET Core 进程配置文件目录

输入命令  mkdir -m 700 /etc/supervisor/conf.d

35f27b9fc76878e0bed987ffa329db40.png

(6)创建Supervisor自启动服务

输入命令  vim /etc/systemd/system/supervisor.service

在文件末尾添加以下代码(注意:首尾需无空格,需顶格)

[Unit]

Description=supervisor

[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

8aff41fc96cded449861c2e22823362f.png

(7)使配置生效

输入命令  systemctl daemon-reload

d7fdf806d3785a9585827e9e638e881c.png

(8)设置开机自启动

输入命令  systemctl enable supervisor.service

1827b22f0727eb05cb7466e53a6ce266.png

(9)启动服务

输入命令   systemctl start supervisor.service

(10)验证DONET进程是否启动

输入命令   ps -ef|grep donet

7ad4deab60374a1b87cdc1917a955925.png

(11)Supervisor远程管理

输入命令  vim /etc/supervisor/supervisord.conf

[inet_http_server]         ; inet (TCP) server disabled by default

port=192.168.1.223:9001        ; ip_address:port specifier, *:port for all iface

username=user              ; default is no username (open server)

password=123               ; default is no password (open server)

3fbd0a686e2cdea1e73e1e3b4406771f.png

(12)重启服务

输入命令

停止 systemctl stop supervisor.service

开启 systemctl start supervisor.service

标签:Core,supervisor,supervisord,命令,etc,conf,Linux,Supervisor,输入

来源: https://blog.csdn.net/u014518337/article/details/90673606

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值