supervisord安装,启动/关闭,添加开机自启动服务

首先给大家推荐一下我老师大神的人工智能教学网站。教学不仅零基础,通俗易懂,而且非常风趣幽默,还时不时有内涵黄段子!点这里可以跳转到网站

centos7安装supervisord

    #yum -y install supervisor

    安装路径/usr/bin/supervisord,配置文件/etc/supervisor.conf

一、手动启动/关闭

supervisor手动启动:

    #/usr/bin/supervisord -c /etc/supervisor.conf

supervisor手动关闭:

    #/usr/bin/supervisorctl stop all    先关闭supervisor启动脚本,之后再关闭supervisord服务

    #kill pid

supervisord开机自启动脚本(各版本系统):https://github.com/Supervisor/initscripts

二、添加开机自启动服务:

centos7 开机自启动脚本:

    #vim /lib/systemd/system/supervisord.service

# supervisord service for sysstemd (CentOS 7.0+)

# by ET-CS (https://github.com/ET-CS)

[Unit]

Description=Supervisor daemon

[Service]

ExecStart=/usr/bin/supervisord

ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown

ExecReload=/usr/bin/supervisorctl $OPTIONS reload

KillMode=process

Restart=on-failure

RestartSec=42s

[Install]

WantedBy=multi-user.target

这个自启动脚本需要修改/etc/supervisord.conf配置文件:

    #vim /etc/supervisrod.conf
        nodaemon=false    改成true

或者:#vim /lib/systemd/system/supervisord.service

[Unit]

Description=Process Monitoring and Control Daemon

After=rc-local.service

[Service]

Type=forking

ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf

SysVStartPriority=99

[Install]

WantedBy=multi-user.target

无需修改/etc/supervisord.conf配置文件

两个自启动脚本都能够添加到systemctl自启动服务

    #systemctl enable supervisord.service

    #systemctl start/restart/stop supervisor.service

原文:http://jasonzhu.blog.51cto.com/5594807/1699581

点这里可以跳转到人工智能网站

发表评论