$ sudo su - #切換為root使用者
# yum install epel-release
# yum install -y supervisor
# systemctl enable supervisord # 開機自啟動
# systemctl start supervisord # 啟動supervisord服務
# systemctl status supervisord # 檢視supervisord服務狀态
# ps -ef|grep supervisord # 檢視是否存在supervisord程序
配置檔案 ini 在/etc/supervisor.d裡面
vim test.ini
[program:test]
command=/usr/local/php/bin/php /www/test/artisan test
directory=/www/test
user=root
autorestart=true
redirect_stderr=true
stdout_logfile=/www/wang/supervisor_error.log
loglevel=info
重新開機
systemctl restart supervisord
啟動程序