1)Installation
sudo apt install supervisor or
sudo apt-get install supervisor
2)cd /etc/supervisor/conf.d 3)create new file inside
sudo vim queue-worker.conf
File Content Note : update path of project
[program:email-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/laravel/artisan queue:work
autostart=true
autorestart=true
user=root
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/laravel/storage/logs/supervisord.log
4)sudo supervisorctl reread
when run this command get output queue-worker:available
5)sudo supervisorctl update
when run this command get output queue-worker:added process group
other command
1)sudo supervisorctl reload
when run this command get output Restarted supervisord
2)sudo service supervisor restart
And its done.
You can check the logs to confirm
sudo nano /var/www/laravel/storage/logs/supervisord.log
Any question ping me on my whatsapp +923142837247