understeam/yii2-supervisor

Installs: 3 706

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 0

Open Issues: 0

Type:yii2-extension

v0.2.1 2016-11-23 07:45 UTC

This package is not auto-updated.

Last update: 2024-12-21 22:08:12 UTC


README

This extension provides controller to run multiple daemon commands as Linux service.

Installation

Preferred way to install extension is through Composer.

$ composer require understeam/yii2-supervisor:~0.2 --prefer-dist

Configuration

Add this controller to your console application configuration and describe Yii commands which should run as daemons:

...
'controllerMap' => [
    'class' => 'understeam\supervisor\SupervisorController',
    'phpBinary' => '/usr/bin/php',  // (optional) Path to php binary
    'yiiFile' => '@app/yii',        // (optional) Path to yii script file
    'commands' => [
        'my-process' => [       // Process group name 
            'command' => [
                'queue/listen', // Yii console action
                'default',      // Arguments
            ],
            'count' => 4,       // Process count
        ],
    ],
],
...

Linux service

You can use this controller as Linux long-running service. There is an example of Unit configuration.