francodacosta / supervisord
Supervisord configuration generator
Installs: 72 790
Dependents: 5
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-11-04 16:17:11 UTC
README
generate supervisord configuration files
<<?php require __DIR__ . '/../../vendor/autoload.php'; use Francodacosta\Supervisord\Loader\ArrayLoader; use Francodacosta\Supervisord\Configuration; use Francodacosta\Supervisord\Processors\CommandConfigurationProcessor; // setup supervisord config object, with a processor for command entries $configuration = new Configuration; $configuration->registerProcessor(new CommandConfigurationProcessor); // configuration to generate $config = array( 'programs' => array( 'cat command' => array('command' => 'tail -f /var/log/messages'), 'ls command' => array('command' => 'ls -la', 'numprocs' => 3), ) ); // load the configuration object from the $config array $loader = new ArrayLoader($config, $configuration); $supervisordConfig = $loader->load(); // dump the generate configuration echo $supervisordConfig->generate();
this generates the following configuraiton
[program:tail] command=tail -f /var/log/messages [program:ls] process_name=%(program_name)s_%(process_num)02d command=ls -la numprocs=3