From 0c87dfda7c531283de45b3c9d886aeda358466ff Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 2 Mar 2011 07:28:10 -0800 Subject: [PATCH] dout: Reopen dout after parsing all config opts Reopen the dout stream only after we parse all configuration options. Specifying --log-file on the command line now works as expected. Signed-off-by: Colin McCabe --- src/common/common_init.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common/common_init.cc b/src/common/common_init.cc index eaf9c6a8a26b6..7683787c812b1 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -154,14 +154,6 @@ void common_init(std::vector& args, const char *module_type, int fl if (force_fg_logging) set_foreground_logging(); - { - // In the long term, it would be best to ensure that we read ceph.conf - // before initializing dout(). For now, just force a reopen here with the - // configuration we have just read. - DoutLocker _dout_locker; - _dout_open_log(); - } - if (g_conf.daemonize) cout << ceph_version_to_string() << std::endl; @@ -175,6 +167,15 @@ void common_init(std::vector& args, const char *module_type, int fl #endif parse_config_options(args); + + { + // In the long term, it would be best to ensure that we read ceph.conf + // before initializing dout(). For now, just force a reopen here with the + // configuration we have just read. + DoutLocker _dout_locker; + _dout_open_log(); + } + install_standard_sighandlers(); #ifdef HAVE_LIBTCMALLOC -- 2.39.5