CentOS7 配置supervisord 自动启动过程

CentOS7 配置supervisord 自动启动过程

1、建立supervisord.service文件

sudo touch /etc/systemd/system/supervisord.service

输入如下内容:

# systemd service file for Supervisor Monitor server
#[Unit]
Description=Supervisor Monitor
After=network.target
After=syslog.target[Install]
WantedBy=multi-user.target[Service]
User=root
Group=root
PIDFile=/home/plone/workspace/Plone5sites/sites/var/supervisord.pid# Disable service start and stop timeout logic of systemd for supervisor service.
TimeoutSec=0
Type=forking
# Start main service
ExecStart=/home/demo/workspace/Plone5sites/sites/bin/supervisord
ExecStop=/home/demo/workspace/Plone5sites/sites/bin/supervisorctl shutdown StartLimitBurst=2
StartLimitInterval=30
Restart=on-failure
PrivateTmp=false
</font></p>

更改权限:

sudo chmod +x /etc/systemd/system/supervisord.service

载入系统,并开启supervisord:

sudo systemctl daemon-reload
sudo systemctl start supervisord.service

测试:

sudo systemctl status supervisord.service
sudo systemctl stop supervisord.service

允许自启动:

sudo systemctl enable supervisord.service
设置