yum install Supervisor
supervisord -c /etc/supervisord.conf

进入 cd /etc 目录 找到supervisord.conf 配置文件 和 supervisord.d 文件夹,使用vim编辑supervisord.conf文件,它会加载supervisord.d文件夹中的所有.ini配置文件

[program:DeployLinux]   #DeployLinux  为程序的名称
command=dotnet DeployLinux.dll #需要执行的命令
directory=/home/publish #命令执行的目录
environment=ASPNETCORE__ENVIRONMENT=Production #环境变量 注释符不用# 环境变量可以省略
user=root #用户
stopsignal=INT
autostart=true #是否自启动
autorestart=true #是否自动重启
startsecs=3 #自动重启时间间隔(s)
stderr_logfile=/var/log/ossoffical.err.log #错误日志文件
stdout_logfile=/var/log/ossoffical.out.log #输出日志文件
配置实例
[program:future_price_depth_new.py]
command=python /bot/mkr/future_price_depth_new.py 注意intergal_util.py用python3启动 [command=python3 /bot/mkr/future_price_depth_new.py]
directory=/bot/mkr/
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=3
stderr_logfile=/bot/log/future_price_depth_new.err.log
stdout_logfile=/bot/log/future_price_depth_new.out.log

supervisorctl reload  //重新加载配置文件

常用命令介绍

supervisorctl 是 supervisord的命令行客户端工具
supervisorctl status:查看所有进程的状态
supervisorctl stop es:停止es
supervisorctl start es:启动es
supervisorctl restart es: 重启es
supervisorctl update :配置文件修改后可以使用该命令加载新的配置
supervisorctl reload: 重新启动配置中的所有程序

或者

supervisord   -c supervisor.conf                     通过配置文件启动supervisor
supervisorctl -c supervisor.conf status 查看状态
supervisorctl -c supervisor.conf reload 重新载入配置文件
supervisorctl -c supervisor.conf start [all]|[x] 启动所有/指定的程序进程
supervisorctl -c supervisor.conf stop [all]|[x] 关闭所有/指定的程序进程
ps -ef|grep python
root 572 1 0 Dec15 ? 00:00:17 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root 7704 7686 1 16:13 pts/2 00:03:06 /root/anaconda3/bin/python3 future_price_depth_new_2.py
root 7726 7708 1 16:13 pts/3 00:03:08 /root/anaconda3/bin/python3 future_price_depth_new.py
root 8291 1 1 Dec06 ? 04:10:59 python future_price_depth_new.py
root 8298 1 1 Dec06 ? 04:06:28 python future_price_depth_new_2.py
root 16948 1 0 19:46 ? 00:00:00 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
root 16949 16948 3 19:46 ? 00:00:00 python /bot/mkr/future_price_depth_new.py
root 16950 16948 7 19:46 ? 00:00:00 python /bot/mkr/timer_util.py
root 16951 16948 9 19:46 ? 00:00:01 python3 /bot/mkr/intergal_util.py
root 16952 16948 9 19:46 ? 00:00:01 python /bot/mkr/mkr.py
root 16953 16948 1 19:46 ? 00:00:00 python /bot/mkr/webs_util.py
root 16963 16952 8 19:46 ? 00:00:00 /root/anaconda3/bin/python /bot/mkr/mkr.py
root 16977 10161 0 19:46 pts/0 00:00:00 grep --color=auto python
root 19717 1 0 Dec15 ? 00:04:00 python -u w267bot.py -273195517 605518038:AAGy5TAoc4DfeW3Ol3ezEryqYEJGgq7mbF0

centos7安装配置supervisor守护进程的更多相关文章

  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守护进程

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

  4. Centos7 使用 Supervisor 守护进程 Celery

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

  5. CentOS7 安装配置笔记

    CentOS7 安装配置笔记 1.通过镜像安装 CentOS7 ==============================* 使用 UltraISO 9.7 或者 rufus-3.5p 制作ISO的 ...

  6. (转)Centos7安装配置NFS服务和挂载

    Centos7安装配置NFS服务和挂载 原文:https://www.u22e.com/601.html NFS简介 NFS(Network File System)即网络文件系统,是FreeBSD支 ...

  7. Centos7安装配置gitlab

    Centos7安装配置gitlab 这篇文字我会介绍在Centos7上安装gitlab,配置gitlab的smtp,并且创建项目demo. sudo yum install openssh-serve ...

  8. Centos7安装配置Apache+PHP+Mysql+phpmyadmin

    转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl ...

  9. Centos7安装配置JDK8

    Centos7安装配置JDK8 一.准备工作 第一步,去甲骨文官网下载Jdk相应的版本,我这里下载的是jdk1.8. 第二步将你从官网上下载下来的jdk使用FTP工具上传到云服务器上的相应目录,我的是 ...

随机推荐

  1. Lesson 8 Trading standards

    What makes trading between rich countires difficult? Chickens slautered in the United States, claim ...

  2. VS2010如何进行程序调试

    VS2010如何进行程序调试 一.前言 对于初步学习C++的朋友,程序的调试是一项必备的技能.尤其是像C++这样难学的语言,程序调试的基本方法更是至关重要.毕竟,谁也不想自己幸幸苦苦一天敲出来的代码就 ...

  3. java反射初探

    java反射 反射是java的重要特性之一,java.lang.reflect 是jdk支持反射的重要包,我下面可能会对构造器Constructor,属性Filed,方法Method会用到.反射其实很 ...

  4. 072、Java面向对象之定义构造方法

    01.代码如下: package TIANPAN; class Book { // 定义一个新的类 public Book() { // 构造方法 System.out.println("* ...

  5. 模拟实现ES6的set类

    function Set() { var items = {}; // this.has = function(value){ // return value in items; // } this. ...

  6. Typora: Markdown Reference (Typora下Markdown语法使用说明)

    引言 由于一直在使用Typora,这个是我使用过的最棒的Markdown编辑器,但是总是忽略某一个功能,于是决定认真看一下其帮助文档 这里做一个简单主要功能的中文翻译(按键对应Windows下). 标 ...

  7. linux环境基于python语言docx转pdf

    windows平台因借助win32com具有多种方法将word转为pdf,但linux环境不具备此环境,win32com包也将import失败,那该如何做呢? # -*- coding: utf-8 ...

  8. vs2010编译C++ 指向指针的指针

    #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _T ...

  9. Ajax发送PUT/DELETE请求时出现错误的原因及解决方案

    本文讲什么? 大家应该都知道.在HTTP中,规定了很多种请求方式,包括POST,PUT,GET,DELETE等.每一种方式都有这种方式的独特的用处,根据英文名称,我们能够很清楚的知道DELETE方法的 ...

  10. KMP【模板】 && 洛谷 P3375

    题目传送门 解题思路: 首先说KMP的作用:对于两个字符串A,B(A.size() > B.size()),求B是否是A的一个字串或B在A里的位置或A里有几个B,说白了就是字符串匹配. 下面创设 ...