Adds command line option "daemon" to Marconi

This patch adds daemon command line option
to Marconi. This enables marconi server to run in
background and thus allows marconi to run under
devstack.

Change-Id: If7da6a17db0005848fd5ac9f745d676f8212d9b7
Closes-Bug: #1287490
This commit is contained in:
Obulapathi N Challa 2014-04-18 12:52:59 -04:00
parent cc199757e1
commit ae4f836904
2 changed files with 12 additions and 2 deletions

View File

@ -35,8 +35,8 @@ def run():
# run under devstack, but it may also be useful for other scenarios.
# Open /dev/zero and /dev/null for redirection.
# Daemonizing marconi-server is needed *just* when running under devstack
# and when `USE_SCREEN` is set to False.
if os.environ.get('USE_SCREEN', '').lower() == 'false':
# and when marconi is invoked with `daemon` command line option.
if conf.daemon:
zerofd = os.open('/dev/zero', os.O_RDONLY)
nullfd = os.open('/dev/null', os.O_WRONLY)

View File

@ -27,6 +27,16 @@ from marconi.queues import transport # NOQA
LOG = log.getLogger(__name__)
_CLI_OPTIONS = (
cfg.BoolOpt('daemon', default=False,
help='Run Marconi server in background.'),
)
# NOTE (Obulpathi): Register daemon command line option for
# marconi-server
CONF = cfg.CONF
CONF.register_cli_opts(_CLI_OPTIONS)
_GENERAL_OPTIONS = (
cfg.BoolOpt('sharding', default=False,
help=('Enable sharding across multiple storage backends. ',