]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
dout: Reopen dout after parsing all config opts
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 2 Mar 2011 15:28:10 +0000 (07:28 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 2 Mar 2011 15:36:00 +0000 (07:36 -0800)
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 <colin.mccabe@dreamhost.com>
src/common/common_init.cc

index eefa09d1601b29f91b9b3b51b9cfc65fe4f8441d..bf284c0c6092a29ed5619746df0364e98c072f28 100644 (file)
@@ -141,6 +141,11 @@ void common_init(std::vector<const char*>& args, const char *module_type, int fl
   if (force_fg_logging)
     set_foreground_logging();
 
+  if (g_conf.daemonize)
+    cout << ceph_version_to_string() << std::endl;
+
+  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
@@ -149,10 +154,6 @@ void common_init(std::vector<const char*>& args, const char *module_type, int fl
     _dout_open_log();
   }
 
-  if (g_conf.daemonize)
-    cout << ceph_version_to_string() << std::endl;
-
-  parse_config_options(args);
   install_standard_sighandlers();
 
 #ifdef HAVE_LIBTCMALLOC