CentOS7+ 或 Ubuntu 16.04+ 下使 supervisord 随系统启动 (systemd)

时间:2021-04-14 00:18:10   收藏:0   阅读:31

https://github.com/Supervisor/initscripts 下载 initscript,注意根据当前机器 supervisor 的安装情况和 supervisor.conf 的配置情况调整 centos-systemd-etcs initscript,

# supervisord service for systemd (CentOS 7.0+, Ubuntu 16.04+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon

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

[Install]
WantedBy=multi-user.target

将其拷贝到 /lib/systemd/system,并重命名为 supervisor.service

$ sudo  cp  centos-systemd-etcs  /lib/systemd/system/supervisor.service

然后 enable 该服务,并启动,

$ sudo systemctl enable supervisor.service
$ sudo systemctl start supervisor.service

然后 supervisor 就可以开机启动了。

 

(完)

 

原文:https://www.cnblogs.com/gaowengang/p/14654746.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!