Supervisor 守护 dotnetcore 程序
版权声明:本文由屈政斌原创文章,转载请注明出处:
文章原文链接:https://www.qcloud.com/community/article/240
来源:腾云阁 https://www.qcloud.com/community
接上篇 腾讯云centos 7部署 dotnetcore+Angular2 实践
环境准备
1.设置nginx 服务开机启动
systemctl enable nginx.servic
2.安装Supervisor
yum install python-setuptools
easy_install supervisor
3.配置Supervisor
mkdir /etc/supervisor
echo_supervisord_conf > /etc/supervisor/supervisord.conf
#指定配置文件
supervisord -c /etc/supervisor/supervisord.conf
指定守护的程序配置
vim /etc/supervisor/supervisord.conf
在最后增加
[include]
files=conf.d/*.conf
配置Supervisor开机启动
新建一个“supervisord.service”文件
# 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”
执行命令:systemctl enable supervisord
配置守护
新增配置
vim /etc/supervisor/conf.d/acore.dll.conf
[program:acore.dll]
command=/bin/bash -c "dotnet acore.dll server.urls=http://127.0.0.1:3000/"
directory=/root/dotnetcore/acore/
autorestart=false
stderr_logfile=/var/log/acore.dll.err.log
stdout_logfile=/var/log/acore.dll.out.log
environment=ASPNETCORE_ENVIRONMENT=Development
user=root
stopsignal=INT
重加载配置
supervisorctl reload
supervisorctl start acore.dll
查看是否被守护进程拉起
重启电脑查看是否自动启动
访问站点OK
Supervisor 守护 dotnetcore 程序的更多相关文章
- 【转载】Centos7 中使用Supervisor守护进程
配置supervisor实现进程守护 1.安装supervisor yum install Supervisor 2.启动服务 supervisord -c /etc/supervisord.co ...
- Centos7 中使用Supervisor守护进程
转:https://www.cnblogs.com/qmhuang/p/8196132.html 配置supervisor实现进程守护 1.安装supervisor yum install Super ...
- Centos7 使用 Supervisor 守护进程 Celery
一.Supervisor 安装(centos7 还有另一个进程守护命令 Systemd ) Centos 7 安装 Supervisord 二.Supervisor 守护进程 Centos7 使用 S ...
- 【Centos7】 中使用Supervisor守护进程
原文出处: Centos7 中使用Supervisor守护进程 配置supervisor实现进程守护 1.安装supervisor yum install Supervisor 2.启动服务 su ...
- supervisor守护filebeat服务进程
1.变更原因 部署安装supervisor进行filebeat守护及后面的各种服务进程守护可以用2.变更内容增加supervisor服务 3.变量时间:6月2号-6月3号4.变更风险评估:无风险4.1 ...
- Python编写守护进程程序
Python编写守护进程程序思路 1. fork子进程,父进程退出通常,我们执行服务端程序的时候都会通过终端连接到服务器,成功连接后会加载shell环境,终端和shell都是进程,shell进程是终端 ...
- Centos7 使用Dockerfile 制作自己的Dotnetcore程序镜像
准备Centos7环境及Docker环境 从Docker hub拉取 Microsoft/dotnet 基础镜像(可以使用国内加速) 向Centos7指定目录上传Dotnet Core程序,目录: / ...
- jenkins结合supervisor进行python程序发布后的自动重启
jenkins结合supervisor进行python程序发布后的自动重启 项目背景: 通过jenkins发布kvaccount.chinasoft.com站点的python服务端程序,业务部门同事需 ...
- 使用supervisor支持Python3程序 (解决找不到Module的问题)
Supervisor是python2写就的一款强大的运维工具(其实现在已经支持Python3了 https://github.com/Supervisor/supervisor)那么怎么利用Super ...
随机推荐
- easyui datagrid使用参考
数据表格 继承$.fn.panel.defaults,使用$.fn.datagrid.defaults重载默认值. 依赖关系 控制面板 缩放 链接按钮 分页 使用方法 <table id=&qu ...
- php 日期时间操作-可算出几天后的时间
本文为大家介绍一下根据PHP时间戳获取当前时期的具体方式.strtotime能将任何英文文本的日期时间描述解析为Unix时间戳,我们结合mktime()或date()格式化日期时间获取指定的时间戳,实 ...
- 动态加载JS
<script> Date.prototype.format = function(format) { var o = { , //month "d+" : this. ...
- 2012 #3 Arcane Numbers
Arcane Numbers 1 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Su ...
- MySQL(五) —— 子查询
子查询(SubQuery)是指出现在其他SQL语句内的SELECT语句. 如: SELECT * FROM t1 WHERE col1 = (SELECT col2 FROM t2); 其中 SELE ...
- git commit时message的问题
1: 在执行git commit的时候,有两种办法为该commit添加message信息一种是git commit -m 'your message'另一种是git commit会打开commit-e ...
- python中的类中属性元素加self.和不加self.的区别
在类中,self只能在函数中使用,表示的是实例属性,就是每个实例可以设置不值,而不相互影响.如果在类级别使用没有self的属性,是类属性,一般作为全局变量来用的.事实上:就是一个是类属性 一个是对象属 ...
- CMD方式修改MySQL的root用户密码
1.CMD下,进行mysql的bin目录下; 2.输入mysql -u root -p,输入旧密码,进入mysql状态: 3.MySQL>use MySQL; 4.update user set ...
- Java中静态和非静态的区别
在网上看到的,感觉还不错,自己笔记下来,以后忘了方便看: 非静态方法是相对于静态方法来说的.静态方法使用static关键字来标示,非静态方法没有此关键字. 他们之间最大的区别在于它们生命周期的不同,静 ...
- JS——JavaScript Confirm
function show_confirm(){var r=confirm("Press a button!");if (r==true) { alert("You pr ...