How to Configure supervisord on Linux for Laravel Jobs Queue

This quick tutorial help to configure Supervisor with Lumen application on Linux.I have already shared tutorial about Queue and Run Jobs using worker in Lumen/Laravel Framework.

Supervisor is a process monitor for the Linux operating system, and will automatically restart your jobs queue using queue:listen or queue:work commands if they fail. You can install Supervisor on Ubuntu using following command,

sudo apt-get install supervisor

supervisord is a simple, fast work queue and designed for reducing the latency of page views in high-volume web applications by running time-consuming tasks asynchronously.

I am assuming you read my previous tutorial that help to install Beanstalkd on linux and download package on lumen application.I am extending this tutorials and configure supervisord for run queue jobs as daemon process.

Step 1: Install supervisor on Linux using below command, if already installed please skip this step.
sudo apt-get install supervisor

Step 2: Kill supervisor process if already running, if not skip this step.

Supervisor configuration files are stored in the /etc/supervisor/conf.d directory.You can create number of configuration file for each process.I will create new test_bq.conf file using below command.

sudo vi /etc/supervisord.d/test_bq.conf

Now added below script into this file,

Step 3: Now We will edit /etc/supervisor.conf file and paste below code into this file.

Step 4: Now Start supervisord using below command.

sudo supervisord -c /etc/supervisord.conf

Additional Supervisor Command