1. 程式人生 > >supervisor自啟動

supervisor自啟動

就是 blank esc 目錄修改 src sudo su serve nsh install

supervisor自啟動
其實自啟動,也就是在主機開啟的時候,執行了sudo supervisord -c /etc/supervisord.conf
創建/usr/lib/systemd/system/supervisord.service文件;
寫入:
# dservice for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon

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

[Install]
WantedBy=multi-user.target

*註意:我的supervisord的目錄是/usr/local/bin/supervisord,需要把上邊目錄修改;
將文件拷貝至:“/usr/lib/systemd/system/supervisord.service”
systemctl enable supervisord

技術分享圖片 clip_image001
驗證一下是否為開機啟動:systemctl is-enabled supervisord
技術分享圖片 clip_image002

Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting

解決方法:

find / -name supervisor.sock

unlink /name/supervisor.sock

unix:///var/run/supervisor.sock no such file

sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart

supervisor自啟動