I want to use Laravel queue system in my project and I want to run php artisan queue:work permanently on server's background, I did some searches about this and I found a command line which can run it even after quit from ssh terminal but It can be down in some cases and can make terrible problems for me. So after a while I found out that there is a package named Supervisord which can restart command even after server is rebooted. But unfortunately my linux knowledge is low so I want to ask someone to help from 0 to 100 step by step how to install Supervisord and config it on centos 7 and after that set the queue command line. Thank you so much..
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
here is how to install and config supervisord on centos 7 to run Laravel queues permanently:
easy_install supervisor
yum install supervisor
vim /etc/supervisord.conf
edit section program as following:
[program:laravel-worker] command=php /path/to/app.com/artisan queue:work process_name=%(program_name)s_%(process_num)02d numprocs=8 priority=999 autostart=true autorestart=true startsecs=1 startretries=3 user=apache redirect_stderr=true stdout_logfile=/path/to/log/worker.log
systemctl enable supervisord
to autorun at startsystemctl restart supervisord
to restart the service