centos7设置supervisor开机启动

新建文件supervisord.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#supervisord.service

[Unit]
Description=Supervisor daemon

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

[Install]
WantedBy=multi-user.target

将文件拷贝到/usr/lib/systemd/system/

1
cp supervisord.service /usr/lib/systemd/system/

启动服务

1
systemctl enable supervisord

验证一下是否为开机启动

1
systemctl is-enabled supervisord
坚持技术分享,您的支持将鼓励我继续创作!