how to run a standalone openstack service foreground

asked 2015-05-27 13:56:17 -0600

Scott Zhang gravatar image

updated 2015-05-27 15:04:21 -0600

rbowen gravatar image


I am wondering if there is a way of running an openstack standalone service foreground? I understand that in devstack all of the services can be run foreground through "screen -x stack". However, if I run a standalone service in a VM, it will switch to background automatically. For example,

[unknown] root@dglncedvt20002:~# service openstack-glance-api start
Redirecting to /bin/systemctl start  openstack-glance-api.service

Is there a way of running such processes foreground? I want to setup breakpoints at server's code in order to debug issues in detail.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-27 15:06:54 -0600

jdexter gravatar image

Most of the services can be run in the foreground you will have to look at the help for each to determine the correct options for calling the configuration files, but an example would be:

  • keystone-all
  • neutron-server
  • nova-api

These are just a few but it should give you a head start.

# glance-api --help
usage: glance-api [-h] [--config-dir DIR] [--config-file PATH] [--debug]
                  [--log-config-append PATH] [--log-date-format DATE_FORMAT]
                  [--log-dir LOG_DIR] [--log-file PATH] [--log-format FORMAT]
                  [--nodebug] [--nouse-syslog] [--nouse-syslog-rfc-format]
                  [--noverbose] [--syslog-log-facility SYSLOG_LOG_FACILITY]
                  [--use-syslog] [--use-syslog-rfc-format] [--verbose]

optional arguments:
  -h, --help            show this help message and exit
  --config-dir DIR      Path to a config directory to pull *.conf files from.
                        This file set is sorted, so as to provide a
                        predictable parse order if individual options are
                        over-ridden. The set is parsed after the file(s)
                        specified via previous --config-file, arguments hence
                        over-ridden options in the directory take precedence.
  --config-file PATH    Path to a config file to use. Multiple config files
                        can be specified, with values in later files taking
                        precedence. The default files used are: None.
  --debug, -d           Print debugging output (set logging level to DEBUG
                        instead of default WARNING level).
  --log-config-append PATH, --log_config PATH
                        The name of a logging configuration file. This file is
                        appended to any existing logging configuration files.
                        For details about logging configuration files, see the
                        Python logging module documentation.
  --log-date-format DATE_FORMAT
                        Format string for %(asctime)s in log records. Default:
                        None .
  --log-dir LOG_DIR, --logdir LOG_DIR
                        (Optional) The base directory used for relative --log-
                        file paths.
  --log-file PATH, --logfile PATH
                        (Optional) Name of log file to output to. If no
                        default is set, logging will go to stdout.
  --log-format FORMAT   DEPRECATED. A logging.Formatter log message format
                        string which may use any of the available
                        logging.LogRecord attributes. This option is
                        deprecated. Please use logging_context_format_string
                        and logging_default_format_string instead.
  --nodebug             The inverse of --debug
  --nouse-syslog        The inverse of --use-syslog
                        The inverse of --use-syslog-rfc-format
  --noverbose           The inverse of --verbose
  --syslog-log-facility SYSLOG_LOG_FACILITY
                        Syslog facility to receive log lines.
  --use-syslog          Use syslog for logging. Existing syslog format is
                        DEPRECATED during I, and will change in J to honor
                        (Optional) Enables or disables syslog rfc5424 format
                        for logging. If enabled, prefixes the MSG part of the
                        syslog message with APP-NAME (RFC5424). The format
                        without the APP-NAME is deprecated in I, and will be
                        removed in J.
  --verbose, -v         Print more verbose output (set logging level to INFO
                        instead of default WARNING level).
  --version             show program's version number and exit
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-05-27 13:56:17 -0600

Seen: 442 times

Last updated: May 27 '15