1.在目录/usr/lib/systemd/system/ 新建文件supervisord.service
2.添加配置内容:
[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 # 开机42后启动[Install]
WantedBy=multi-user.target
3.启动服务 systemctl enable supervisord
4.验证一下是否为开机启动 systemctl is-enabled supervisord