supervisor 這個(gè)軟件只能在 unix 環(huán)境運(yùn)行棚亩,沒有 windows 版识埋,mac 可以
1. 安裝
yum install supervisor -y
配置文件目錄:
/etc/supervisor.conf
開機(jī)啟動(dòng)文件:/usr/lib/systemd/system/supervisord.service
如果沒有開機(jī)啟動(dòng)文件染乌,則添加一個(gè)
[Unit]
Description=Process Monitoring and Control Daemon
After=rc-local.service nss-user-lookup.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
[Install]
WantedBy=multi-user.target
2. 檢查是否為開機(jī)啟動(dòng)
systemctl is-enabled supervisord
3. 設(shè)置為開機(jī)啟動(dòng)
systemctl enable supervisord
附錄
常用的相關(guān)命令
supervisorctl restart <application name> ;重啟指定應(yīng)用
supervisorctl stop <application name> ;停止指定應(yīng)用
supervisorctl start <application name> ;啟動(dòng)指定應(yīng)用
supervisorctl restart all ;重啟所有應(yīng)用
supervisorctl stop all ;停止所有應(yīng)用
supervisorctl start all ;啟動(dòng)所有應(yīng)用