DEV Community

Rupadana
Rupadana

Posted on

Install and Manage Supervisor for Laravel Queue

Introduction

In this post im using ubuntu 22.04, read the installation step below

Installation

Begin by updating your package sources and installing Supervisor:

sudo apt update && sudo apt install supervisor
Enter fullscreen mode Exit fullscreen mode

The supervisor service runs automatically after installation. You can check its status:

sudo systemctl status supervisor
Enter fullscreen mode Exit fullscreen mode

You should receive the following output:

Output
● supervisor.service - Supervisor process control system for UNIX
     Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-11-17 22:56:48 UTC; 5min ago
Enter fullscreen mode Exit fullscreen mode

Add configuration

create app.rupadana.com.conf configuration to /etc/supervisor/conf.d, and paste it

[program:rupadana-app]
process_name=%(program_name)s_%(process_num)02d
command=php /home/rupadana-app/htdocs/app.rupadana.com/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=rupadana-app
numprocs=2
redirect_stderr=true
stdout_logfile = /home/app/htdocs/app.rupadana.com/worker.log
stopwaitsecs=3600
Enter fullscreen mode Exit fullscreen mode

and enter this command to run configuration

sudo supervisorctl reread
sudo supervisorctl update
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
rupadana profile image
Rupadana

Hi, kindly leave a like and comment if you got new insight! 🔥