ginkgo -c path/to/myservice.conf.py
The config would say whether to daemonize or not. Etc. Most of the
hardcoded arguments would go back into configuration land. The only
options the runner would have are:
-c, --config Point to your configuration file (or several of
them, executed in order)
-s, --service Point to a Python module and class using default
configuration (ie mymodule.MyService)
If you're service wants to expose configuring to the CLI, you can pull
from the environment explicitly in your config:
# myservice.conf.py
import os
port = int(os.environ.get("PORT", 5000))
Then you could do:
PORT=9000 ginkgo -c path/to/myservice.cong.py
But then, hey, what about start, stop, restart, reload, etc?
These would be pulled out into a separate command with similar
arguments, but since it is about sending signals to your process, you
can also just specify a pid:
ginkgoctl -c path/to/myservice.cong.py start
ginkgoctl -c path/to/myservice.cong.py stop
ginkgoctl -c path/to/myservice.cong.py reload
This assumes the config has a pidfile and you daemonize. Let's say you
start it with:
ginkgo -s mymodule.MyService
That would start a process in the foreground. You could still use
ginkgoctl to interact with it:
ginkgoctl -p 2745 reload
Anyway, this separates concerns a bit more and makes the simple case
much more common. And if you don't want to use ginkgoctl because you
have some other process manager (upstart, whatever), you don't have
to.