PHPackages                             juhniorsantos/supervisord - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. juhniorsantos/supervisord

ActiveLibrary[Queues &amp; Workers](/categories/queues)

juhniorsantos/supervisord
=========================

A simple and elegant Laravel package for managing Supervisor (supervisord) workers. List, start, stop, restart, create and delete workers directly from Laravel using Artisan commands or the Facade.

v1.0.0(4mo ago)02MITPHPPHP ^8.1

Since Jan 10Pushed 4mo agoCompare

[ Source](https://github.com/juhniorsantos/supervisord)[ Packagist](https://packagist.org/packages/juhniorsantos/supervisord)[ RSS](/packages/juhniorsantos-supervisord/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Supervisord
===================

[](#laravel-supervisord)

A simple and elegant Laravel package for managing Supervisor (supervisord) workers. List, start, stop, restart, create and delete workers directly from Laravel using Artisan commands or the Facade.

Features
--------

[](#features)

- **List workers** - View status of all workers or specific groups
- **Control workers** - Start, stop and restart workers individually or in bulk
- **Manage configurations** - Create, update and delete worker configuration files
- **Artisan commands** - Full CLI support for all operations
- **Facade &amp; DI** - Use the Facade or inject the interface
- **Laravel 10, 11 &amp; 12** - Compatible with the latest Laravel versions
- **No database required** - Works directly with supervisorctl

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.0+, 11.0+ or 12.0+
- Supervisor installed on the system

Installation
------------

[](#installation)

```
composer require juhniorsantos/supervisord
```

The package will auto-register its service provider and facade.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=supervisord-config
```

This will create `config/supervisord.php`:

```
return [
    'supervisorctl_path' => env('SUPERVISORD_CTL_PATH', '/usr/bin/supervisorctl'),
    'config_path' => env('SUPERVISORD_CONFIG_PATH', '/etc/supervisor/conf.d'),
    'config_extension' => '.conf',
    'timeout' => env('SUPERVISORD_TIMEOUT', 30),
    'default_worker_config' => [
        'command' => 'php artisan queue:work',
        'autostart' => true,
        'autorestart' => true,
        'numprocs' => 1,
        'redirect_stderr' => true,
    ],
];
```

### Environment Variables

[](#environment-variables)

Add these to your `.env` file as needed:

```
SUPERVISORD_CTL_PATH=/usr/bin/supervisorctl
SUPERVISORD_CONFIG_PATH=/etc/supervisor/conf.d
SUPERVISORD_TIMEOUT=30
```

### Permissions

[](#permissions)

If you encounter a permission error like:

```
Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py

```

You need to configure the supervisor socket to allow access to your web server user.

#### Configure supervisor socket permissions

[](#configure-supervisor-socket-permissions)

Edit the supervisor configuration file:

```
sudo nano /etc/supervisor/supervisord.conf
```

Find the `[unix_http_server]` section and change it to allow access to the `www-data` group:

```
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:www-data
```

Or for Laravel Forge, use the `forge` group:

```
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:forge
```

Then restart supervisor:

```
sudo systemctl restart supervisor
```

Verify the permissions:

```
ls -la /var/run/supervisor.sock
# Should show: srwxrwx--- 1 root www-data (or forge)
```

Usage
-----

[](#usage)

### Artisan Commands

[](#artisan-commands)

#### List all workers

[](#list-all-workers)

```
php artisan supervisord:status
```

#### Check status of a specific worker

[](#check-status-of-a-specific-worker)

```
php artisan supervisord:status worker:worker_00
```

#### Check status of a worker group

[](#check-status-of-a-worker-group)

```
php artisan supervisord:status "my-group:*"
# or
php artisan supervisord:status my-group --group
```

#### Start workers

[](#start-workers)

```
# Start a single worker
php artisan supervisord:start worker:worker_00

# Start multiple workers
php artisan supervisord:start worker1:worker1_00 worker2:worker2_00

# Start a group
php artisan supervisord:start "my-group:*"

# Start all workers
php artisan supervisord:start --all
```

#### Stop workers

[](#stop-workers)

```
php artisan supervisord:stop worker:worker_00
php artisan supervisord:stop --all
```

#### Restart workers

[](#restart-workers)

```
# Restart a single worker
php artisan supervisord:restart worker:worker_00

# Restart multiple workers
php artisan supervisord:restart worker1:worker1_00 worker2:worker2_00

# Restart all workers
php artisan supervisord:restart --all
```

#### Create a new worker

[](#create-a-new-worker)

```
php artisan supervisord:create my-worker \
    --command="php artisan queue:work redis --queue=high" \
    --numprocs=3 \
    --directory=/var/www/app \
    --autostart \
    --autorestart
```

#### Delete a worker

[](#delete-a-worker)

```
php artisan supervisord:delete my-worker

# Skip confirmation
php artisan supervisord:delete my-worker --force
```

### Facade Usage

[](#facade-usage)

```
use JuhniorSantos\Supervisord\Facades\Supervisord;

// List all workers
$workers = Supervisord::all();

// Get status of a specific worker
$worker = Supervisord::status('worker:worker_00');
echo $worker->status->value; // RUNNING, STOPPED, etc.
echo $worker->pid;
echo $worker->uptime;

// Get status of a worker group
$group = Supervisord::groupStatus('my-group');
echo $group->runningCount();
echo $group->stoppedCount();

// Start/Stop/Restart workers
Supervisord::start('worker:worker_00');
Supervisord::stop('worker:worker_00');
Supervisord::restart('worker:worker_00');

// Restart multiple workers
$results = Supervisord::restartMany([
    'worker1:worker1_00',
    'worker2:worker2_00',
]);
// Returns: ['worker1:worker1_00' => true, 'worker2:worker2_00' => true]

// Create a new worker
Supervisord::create('my-worker', [
    'command' => 'php artisan queue:work redis --queue=high',
    'numprocs' => 3,
    'directory' => '/var/www/app',
    'autostart' => true,
    'autorestart' => true,
]);

// Update an existing worker
Supervisord::update('my-worker', [
    'numprocs' => 5,
]);

// Delete a worker
Supervisord::delete('my-worker');

// Reload supervisor configuration
Supervisord::reread();
Supervisord::reload();

// Bulk operations
Supervisord::startAll();
Supervisord::stopAll();
Supervisord::restartAll();

// Get all groups
$groups = Supervisord::groups();

// Check if worker exists
if (Supervisord::exists('worker:worker_00')) {
    // ...
}

// Check if configuration file exists
if (Supervisord::configExists('my-worker')) {
    // ...
}
```

### Dependency Injection

[](#dependency-injection)

```
use JuhniorSantos\Supervisord\Contracts\SupervisorInterface;

class MyController
{
    public function __construct(
        protected SupervisorInterface $supervisor
    ) {}

    public function index()
    {
        $workers = $this->supervisor->all();
        // ...
    }
}
```

DTOs
----

[](#dtos)

### Worker

[](#worker)

```
use JuhniorSantos\Supervisord\DTOs\Worker;

$worker = Supervisord::status('worker:worker_00');

$worker->name;        // Full name (e.g., "worker:worker_00")
$worker->group;       // Group name (e.g., "worker")
$worker->processName; // Process name (e.g., "worker_00")
$worker->status;      // WorkerStatus enum
$worker->pid;         // Process ID (nullable)
$worker->uptime;      // Uptime string (nullable)

$worker->isRunning(); // bool
$worker->isStopped(); // bool
$worker->hasError();  // bool
$worker->fullName();  // "group:processName"
$worker->toArray();   // Array representation
```

### WorkerGroup

[](#workergroup)

```
use JuhniorSantos\Supervisord\DTOs\WorkerGroup;

$group = Supervisord::groupStatus('my-group');

$group->name;           // Group name
$group->workers;        // Collection of Worker objects
$group->count();        // Total workers
$group->runningCount(); // Running workers
$group->stoppedCount(); // Stopped workers
$group->errorCount();   // Workers with errors
$group->allRunning();   // bool
$group->allStopped();   // bool
$group->hasErrors();    // bool
$group->getWorkerNames(); // Array of full names
$group->toArray();      // Array representation
```

### WorkerStatus Enum

[](#workerstatus-enum)

```
use JuhniorSantos\Supervisord\Enums\WorkerStatus;

WorkerStatus::RUNNING;
WorkerStatus::STOPPED;
WorkerStatus::STARTING;
WorkerStatus::STOPPING;
WorkerStatus::FATAL;
WorkerStatus::EXITED;
WorkerStatus::BACKOFF;
WorkerStatus::UNKNOWN;

$status->isRunning();      // bool
$status->isStopped();      // bool
$status->isError();        // bool
$status->isTransitioning(); // bool
$status->color();          // Color for CLI output
```

Exception Handling
------------------

[](#exception-handling)

```
use JuhniorSantos\Supervisord\Exceptions\SupervisorException;
use JuhniorSantos\Supervisord\Exceptions\WorkerNotFoundException;
use JuhniorSantos\Supervisord\Exceptions\ConfigurationException;

try {
    $worker = Supervisord::status('non-existent:worker');
} catch (WorkerNotFoundException $e) {
    // Worker not found
} catch (ConfigurationException $e) {
    // Configuration error
} catch (SupervisorException $e) {
    // General supervisor error
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance78

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

122d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61774bd587c2be883def28e3c98d79a6e77070c25d6106882fc30977fabbe23a?d=identicon)[juhniorsantos](/maintainers/juhniorsantos)

---

Top Contributors

[![juhniorsantos](https://avatars.githubusercontent.com/u/8250414?v=4)](https://github.com/juhniorsantos "juhniorsantos (2 commits)")

---

Tags

laravelqueuedaemonsupervisorprocess managerworkerssupervisordprocess-controlworker-management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juhniorsantos-supervisord/health.svg)

```
[![Health](https://phpackages.com/badges/juhniorsantos-supervisord/health.svg)](https://phpackages.com/packages/juhniorsantos-supervisord)
```

###  Alternatives

[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[foxxmd/laravel-elasticbeanstalk-queue-worker

Deploy your Laravel application as a queue worker on AWS ElasticBeanstalk

5493.5k](/packages/foxxmd-laravel-elasticbeanstalk-queue-worker)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
