mozilla-services/circus — pull request #21 by benoitc (2012-03-03 02:07:28+00:00)
Title: new commands to register/unregister dynamically shows

This patch introduces new command to manage workers.

Generic command to start/stop & restart shows:

- `status `: get status of a show, active or stopped
- `start `: start a show
- `stop `: stop a show
- `restart `: restart a show
- `star_works` : start all stopped workers
- `stop_workes`: stop all workers
- `restart_works`: restart all workers
- `numshows`: display the number of managed shows.

New commands to register/unregister shows and set their options. It's now possible to add, remove dynamically shows and set their
options. New commands are:

- `add_show `: add a show and the command line to use.
the new created show need to be started manually with the command
`start `.
- `del_show `: remove a show from the list of show. This
change is irreversible.
- `set key value`: set an option in the show showname.
- `mset key1 value1 key2 value2`: Like set but allows to set
multiple key/value pairs
- `options `: display all options values.
- `get `: get an option value
- `mget option1 option2`: like get but for multiple values.

Show options are:

- `num_flies`: set the number of flies to use
- `warmup_delay`: delay to wait between each fly launch
- `working_dir`: the working directory
- `uid`: The uid to use to launch the fly (int or user name)
- `gid`: The gid to use to launch the fly (int or group name)
- `send_hup`: true or false, send teh signal HUP to the fly instead of
stopping and starting it.
- `shell`: true or false, if true the program will be launched in a
shell.
- `env`: a list of key=value separated by a comma. Set the environnement
variables for this process.

Note: when an option or multiple options are changed, the configuration
is automatically applied to the process. Depending the context flies are gracefully restarted or managed (spawn new flies or kill flies depending on their number).