Ad

Supervise Queue In Laravel 5.1

I an using laravel 5.1 and Redis database for the queue. I want to supervise the queue:listen command Application is hosted in AWS.

For the installation I have used following command

sudo su -             //it would be root user
easy_install supervisor
echo_supervisord_conf
echo_supervisord_conf > /etc/supervisord.conf
cd /etc
sudo vim supervisord.conf

Add the following line at the bottom

[program:queue]
command=/usr/bin/php /var/www/html/artisan --env="production" --timeout 240 queue:listen

and then

supervisord -c /etc/supervisord.conf

supervisorctl status

It generates the following log Screenshot of Error log

Ad

Answer

sudo su -             //it would be root user
easy_install supervisor
echo_supervisord_conf
echo_supervisord_conf > /etc/supervisord.conf
sudo vim /etc/supervisord.conf

Add the following code at the end of the file supervisord.conf

[program:queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work sqs --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/supervisord.log

Run following command to start

supervisord -c /etc/supervisord.conf                  //To start
supervisorctl status
Ad
source: stackoverflow.com
Ad