francodacosta/symfony-supervisord

Supervisord configuration generator bundle for symfony2

0.1.1 2016-06-10 08:30 UTC

This package is not auto-updated.

Last update: 2024-12-21 16:25:55 UTC


README

This bundle will help you generate the supervisord configuration for your commands

Installation

this bundle can be installed via composer:

{
    "require": {
        "francodacosta/symfony-supervisord": "dev-master"
    }
}

How to use it

Create a file in /Resouces/config/supervisord.yml

programs:
  program-alias:
    command: ls -la

you can use any valid supervisord setting for your programs, you can also use symfony parameters.

a more advanced example:

programs:
  ls-command:
    command: ls -la
    
  cat-command:
    command: cat /var/log/messages.log
    
  amqp-consumer:
    command: my-consumer.php --queue %consumer.queue%

running app/console supervisord:setup --output /path/to/file will produce a file with the following content:

[program:ls]
command=ls -la

[program:cat]
command=cat /var/log/messages.log

[program:my-consumer.php]
command=my-consumer.php --queue my-queue
process_name=%(program_name)s_%(process_num)02d
numprocs=3

All you need to do is to include it in your supervidord.conf main file.