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. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:设置元素为 display:block 并居中显示

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  2. python的线性代数

    估计线性模型中的系数:a=np.linalg.lstsq(x,b),有b=a*x 求方阵的逆矩阵np.linalg.inv(A) 求广义逆矩阵:np.linalg.pinv(A) 求矩阵的行列式:np ...

  3. day16-Python运维开发基础(os / os.path / shutil模块)

    1. OS模块与shutil模块 os :新建/删除shutil: 复制/移动 # ### os模块 与 shutil模块 """ os 新建/删除 shutil 复制/ ...

  4. bootloader 详细介绍

    Bootloader 对于计算机系统来说,从开机上电到操作系统启动需要一个引导过程.嵌入式Linux系统同样离不开引导程序,这个引导程序就叫作Bootloader. 6.1.1  Bootloader ...

  5. redis api-list

  6. 启动nginx出错:open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

    [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 解决:mkdir / ...

  7. PHP 符号大全

    注解符号: // 单行注解 /*      */    多行注解 引号的使用 ’   ’ 单引号,没有任何意义,不经任何处理直接拿过来; " "双引号,PHP动态处理然后输出,一般 ...

  8. 080、Java数组之二维数组的定义及使用

    01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...

  9. Mac如何自定义本地化文件夹名

    1. 关闭系统文件保护 在一切开始前,首先要先关闭掉系统的文件保护机制,否则无法修改系统文件,参见`如何关闭 Mac OS X EI Capitan 系统文件保护`这篇文章 2. 添加自定义本地化名称 ...

  10. 获取JSHANDLE句柄

    A string can also be passed in instead of a function: const aHandle = await page.evaluateHandle('doc ...