vrok / supervisor-control
ZF3 Module for supervisord management
Requires
- php: >=7.1
- mondalaci/supervisor-client: dev-master
- zendframework/zend-component-installer: ^0.6.0
- zendframework/zend-mvc: ^3.1.0
- zendframework/zend-mvc-console: ^1.1.11
- zendframework/zend-mvc-form: ^1.0.0
- zendframework/zend-mvc-plugin-flashmessenger: ^1.0.0
Requires (Dev)
- phpunit/phpunit: ^6.4.1
- zendframework/zend-coding-standard: ~1.0.0
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.