centos7上使用systemd启动supervisor

添加文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
vim /usr/lib/systemd/system/supervisord.service
[Unit]
Description=Supervisor daemon

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

[Install]
WantedBy=multi-user.target

激活 & 启动:

1
2
systemctl enable supervisord.service
systemctl start supervisord.service

如果修改了文件,可以通过reload命令来重新加载 supervisord.service 文件

1
systemctl reload supervisord.service