You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a command that parses command-line arguments, reads a configuration file and then run or stop daemons (this issue).
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 setuidgid = 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).
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).
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).
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.
This issue is actually related to lots of tasks and has some dependencies:
Broker
,Router
andPipeliner
classes - more on Broker should not ask for configuration (to Router) #56, Easily-configurable Router #57 and Easily-configurable Pipeliner #58;from_configuration
- more on Create helper to read configuration file and returns adict
#59;Broker
,Router
andPipeliner
'sstart
methods as a daemon - more on Run daemons as actually Unix daemons #60;A sample config file should be like:
All
store_*
directives insidebroker
section should be passed toBroker
and then toStoreClass.__init__
, as Broker should not ask for configuration to Router (as described in #56).And the main usage should be like:
Some command-line arguments are worth implementing:
-f <config-file>
: specify a configuration file to be used.-
meansstdin
. If not specified, try/etc/pypelinin.conf
,$HOME/.pypelinin
-c <config-file>
: specify a configuration file to be checked.-
meansstdin
-g <config-file>
: specify a configuration file to be generated (as an example).-
meansstdin
--version
,-V
(or maybe-v
): printspypelinin
version (pypelinin.__version__
) and exit-h
,--help
: show help information about command-line arguments and exitA manual page for
pypelinin
command is also desired, but it's not really needed on the first implementation.The text was updated successfully, but these errors were encountered: