I recently setup a Laravel Queue system. The basics are a cronjob calls a command which adds jobs to a queue and calls a second command which sends an email.
The sy
For CentOS7
yum install supervisor
Then create a file in /etc/supervisord.d/filename.ini With content
[program:laravel-worker]
command=/usr/bin/php /home/appuser/public_html/artisan queue:listen
process_name=%(program_name)s_%(process_num)02d
numprocs=5
priority=999
autostart=true
autorestart=true
startsecs=1
startretries=3
user=appuser
redirect_stderr=true
stdout_logfile=/path/logpath/artisan.log
Then start the supervisord service using
systemctl restart supervisord
Enable supervisord service to run on boot using
systemctl enable supervisord
Check if the service is running using
ps aux | grep artisan
You should see the process running if it was set up properly. Similar to the output below.
[root@server ~]# ps aux | grep artisan
appuser 17444 0.1 0.8 378656 31068 ? S 12:43 0:05 /usr/bin/php /home/appuser/public_html/artisan queue:listen