版权声明:本文由屈政斌原创文章,转载请注明出处: 
文章原文链接: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 程序的更多相关文章

  1. 【转载】Centos7 中使用Supervisor守护进程

    配置supervisor实现进程守护 1.安装supervisor yum install Supervisor   2.启动服务 supervisord -c /etc/supervisord.co ...

  2. Centos7 中使用Supervisor守护进程

    转:https://www.cnblogs.com/qmhuang/p/8196132.html 配置supervisor实现进程守护 1.安装supervisor yum install Super ...

  3. Centos7 使用 Supervisor 守护进程 Celery

    一.Supervisor 安装(centos7 还有另一个进程守护命令 Systemd ) Centos 7 安装 Supervisord 二.Supervisor 守护进程 Centos7 使用 S ...

  4. 【Centos7】 中使用Supervisor守护进程

    原文出处: Centos7 中使用Supervisor守护进程 配置supervisor实现进程守护 1.安装supervisor yum install Supervisor   2.启动服务 su ...

  5. supervisor守护filebeat服务进程

    1.变更原因 部署安装supervisor进行filebeat守护及后面的各种服务进程守护可以用2.变更内容增加supervisor服务 3.变量时间:6月2号-6月3号4.变更风险评估:无风险4.1 ...

  6. Python编写守护进程程序

    Python编写守护进程程序思路 1. fork子进程,父进程退出通常,我们执行服务端程序的时候都会通过终端连接到服务器,成功连接后会加载shell环境,终端和shell都是进程,shell进程是终端 ...

  7. Centos7 使用Dockerfile 制作自己的Dotnetcore程序镜像

    准备Centos7环境及Docker环境 从Docker hub拉取 Microsoft/dotnet 基础镜像(可以使用国内加速) 向Centos7指定目录上传Dotnet Core程序,目录: / ...

  8. jenkins结合supervisor进行python程序发布后的自动重启

    jenkins结合supervisor进行python程序发布后的自动重启 项目背景: 通过jenkins发布kvaccount.chinasoft.com站点的python服务端程序,业务部门同事需 ...

  9. 使用supervisor支持Python3程序 (解决找不到Module的问题)

    Supervisor是python2写就的一款强大的运维工具(其实现在已经支持Python3了 https://github.com/Supervisor/supervisor)那么怎么利用Super ...

随机推荐

  1. jquery简单插件到复杂插件(2)--简单手风琴

    手风琴就是展示与隐藏 <div id="dataContent"> <div class="dataLeft fl"> <div ...

  2. 2015年江西理工大学C语言程序设计竞赛(初级组)

    JankTao相亲记 解法:排序 #include<stdio.h> #include<string.h> #include<iostream> #include& ...

  3. redis基本数据类型及方法

    redis支持的数据类型 String redis最基本的类型,可以是任意类型的字符串,也可以是数字 SET 赋值,用法: SET key value GET 取值,用法: GET key INCR  ...

  4. C堆栈

    C堆栈实现的表达式求值 //Luangeng #include<stdio.h> #include<conio.h> #include<windows.h> #de ...

  5. Springmvc整合tiles框架简单入门示例(maven)

    Springmvc整合tiles框架简单入门示例(maven) 本教程基于Springmvc,spring mvc和maven怎么弄就不具体说了,这边就只简单说tiles框架的整合. 先贴上源码(免积 ...

  6. Swift语法总结补充(一)

    Swift基础语法学习总结Swift高级语法学习总结Swift语法总结补充(一) 1. 可选类型是一种类型,String?就是Optional<String>,所以函数参数也可以声明为它2 ...

  7. 手机开机画面制作工具(LogoBuilder)

    手机开机画面制作工具(LogoBuilder) 本人想在自己的设备中采用其他设备上开机的logo,首先需要此设备上的logo.bin,然后用LogoBuilder解压出来,具体步骤如下: 1.     ...

  8. 【转载】为什么CPU有多层缓存

    原文:为什么CPU有多层缓存 http://mp.weixin.qq.com/s?__biz=MzI1NDM2Nzg5Mw==&mid=2247483712&idx=1&sn= ...

  9. MYSQL写入数据时报错ERROR 1366 (HY000): Incorrect string value: '\xE8\x8B\xB1\xE5\xAF\xB8...' for c 插入中文不能插入

    先把原先你创建的这个表删除,然后 CREATE TABLE IF NOT EXISTS tdb_goods( goods_id SMALLINT UNSIGNED PRIMARY KEY AUTO_I ...

  10. ajax请求、servlet返回json数据

    ajax请求.servlet返回json数据 1.方式一 response.setcontenttype("text/html;charset=utf-8"); response. ...