版权声明:本文由屈政斌原创文章,转载请注明出处: 
文章原文链接: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. reactjs入门到实战(五)---- props详解

    1>>>基础的props使用     不可修改父属性    getDefaultProps   对于外界/父组件的属性值,无法直接修改,它是只读的. <script type= ...

  2. 第四课 Activity

    1.Activity生命周期 1.1 创建-->启动-->获取焦点-->running-->失去焦点-->停止-->销毁.(一个正常activity的生命周期) 1 ...

  3. 查询mysql数据库中所有用户及用户权限

    SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

  4. Visual Studio安装项目中将用户选择的安装路径写入注册表的方法[转]

    在你的工程名上右击 -> View ->Registry(视图 -> 注册表) 在你需要写注册表的主键下,例如我注册firefox插件的例子是: (1)右击HKEY_CURRENT_ ...

  5. 【leetcode❤python】26. Remove Duplicates from Sorted Array

    #-*- coding: UTF-8 -*-class Solution(object):    def removeDuplicates(self, nums):        "&quo ...

  6. 详解CreateProcess调用内核创建进程的过程

    昨天同学接到了腾讯的电面,有一题问到了CreateProcess创建进程的具体实现过程,他答得不怎么好吧应该是, 为了以防万一,也为了深入学习一下,今天我翻阅了好多资料,整理了一下,写篇博客,也算是加 ...

  7. Formatting Excel File Using Ole2 In Oracle Forms

    Below is the some useful commands of Ole2 to format excel file in Oracle Forms.-- Change font size a ...

  8. django-crontab定时任务

    django-crontab实现定时任务 1 django-crontab安装 django-crontab安装: django-crontab加入:只需要将INSTALLED_APPS即可.如下代码 ...

  9. 【转】雪崩光电二极管(APD)偏置电源及其电流监测

    摘要:本文提供的参考设计用于实现APD偏置电源及其电流监测.基于MAX15031 DC-DC转换器,该电路能够将2.7V至11V范围的输入电压经过DC-DC电源转换器后得到一个70V.4mA电源. 下 ...

  10. EditPlus添加到右键菜单

    1.Alt+R 键打开“运行” 2.“运行”中输入:regedit 打开注册表    (1.在 "我的电脑HKEY_CLASSES_ROOT*" 下新建项 shell: (2.在 ...