Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a CLI to run daemons #44

Open
turicas opened this issue Feb 27, 2013 · 5 comments
Open

Create a CLI to run daemons #44

turicas opened this issue Feb 27, 2013 · 5 comments

Comments

@turicas
Copy link
Contributor

turicas commented Feb 27, 2013

This issue is actually related to lots of tasks and has some dependencies:

A sample config file should be like:

[global]
working_directory = /home/my_project/
api = tcp://127.0.0.1:5550
broadcast = tcp://127.0.0.1:5551
uid = my_user # optional, only if needs setuid
gid = my_group # optional, only if needs setgid

[router]
name = My Router
log_path = /tmp/router.log
pid_file = /tmp/router.pid

[pipeliner]
name = My Pipeliner
log_path = /tmp/pipeliner.log
pid_file = /tmp/pipeliner.pid

[broker]
name = My Broker
log_path = /tmp/broker.log
pid_file = /tmp/broker.pid
worker_module = workers
store_class = mymodule.MyStoreClass
number_of_workers = 40
store_custom_config_1 = my-value
store_custom_config_2 = other-value

All store_* directives inside broker section should be passed to Broker and then to StoreClass.__init__, as Broker should not ask for configuration to Router (as described in #56).

And the main usage should be like:

pypelinin -f pypelinin.conf <start|stop|restart> <all|router|pipeliner|broker>

Some command-line arguments are worth implementing:

  • -f <config-file>: specify a configuration file to be used. - means stdin. If not specified, try /etc/pypelinin.conf, $HOME/.pypelinin
  • -c <config-file>: specify a configuration file to be checked. - means stdin
  • -g <config-file>: specify a configuration file to be generated (as an example). - means stdin
  • --version, -V (or maybe -v): prints pypelinin version (pypelinin.__version__) and exit
  • -h, --help: show help information about command-line arguments and exit

A manual page for pypelinin command is also desired, but it's not really needed on the first implementation.

@israelst
Copy link

Good shot!

@turicas
Copy link
Contributor Author

turicas commented Feb 28, 2013

Would be nice if we are able to specify a cluster shared cryptography key (for authentication of the daemons) in this config file too (but #11 needs to be implemented before it).

@turicas
Copy link
Contributor Author

turicas commented Mar 1, 2013

Currently, the "daemons" are not real daemons since they do not detach from tty, neither create new process session id and other things daemons should do by definition (read more about UNIX daemons at Wikipedia).
We should use the library python-daemon (described in PEP-3143) to implement it (it's very easy to use).

@turicas
Copy link
Contributor Author

turicas commented Mar 9, 2013

Since there are lots of tasks involved in this, I've created other issues (as dependencies of this one) and updated its description with dependencies and describing some possible command-line options.

@israelst
Copy link

We could use something like number_of_workers_per_cpu instead of number_of_workers in order to have more flexibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants