2104091338@CentOS7配置Supervisor开机启动

Author Avatar
ClueeZhuo 4月 09, 2021

1. 在自己桌面新建一个supervisord.service文件

内容为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[Unit]
Description=Supervisor daemon

[Service]
Type=forking
ExecStart=/usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecStop=/usr/local/bin/supervisorctl shutdown
ExecReload=/usr/local/bin/supervisorctl reload
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

2. 将此文件拷贝到/usr/lib/systemd/system文件夹下

3. 执行命令:

1
systemctl enable supervisord

4. 执行命令测试是否为开机启动

1
systemctl is-enabled supervisord