vrok/supervisor-control

ZF3 Module for supervisord management

v2.1.0 2017-10-10 15:07 UTC

This package is auto-updated.

Last update: 2024-11-15 23:12:55 UTC


README

ZF3 Module for supervisord management based on mondalaci/supervisor-client. Offers a frontend that allows to restart the supervisord daemon and start/stop single processes, all processes of a group or all configured processes. Shows information about the configured programm groups and the running processes.

Configuration

Add to config/autoload/supervisorcontrol.local.php:

    'supervisor_client' => [
        'hostname' => 'unix:///var/lib/supervisord/supervisor.sock',
        'port'     => -1,
    ],

or:

    'supervisor_client' => [
        'hostname' => '127.0.0.1',
        'port'     => 9001,
    ],

Usage

Entry route is /supervisor-control

Notice: To use supervisor.getProcessInfo() with a program group that uses numprocs > 1 the full qualified name (FQN, "group:process") of a process is required:

[program:myprog]
numprocs     = 2
process_name = myprog-%(process_num)d

This will produce process names like myprog-0, myprog-1. When calling getProcessInfo("myprog-0") an exception with BAD_NAME will be thrown, use getProcessInfo("myprog:myprog-0") instead. This module overrides getProcessInfo to construct the FQN automatically before querying the API. The extended client functions getProcessConfig, processExists, getProcessState and isProcessRunning work when either the short name or FQN is given.

Todo

Adjust route constraints to allow all possible group/process names, [a-zA-Z0-9_-]+ is probably to restrictive.

Implement twiddler support for modifying and reloading the configuration.