From: Sage Weil Date: Tue, 6 Feb 2018 18:56:44 +0000 (-0600) Subject: global/global_init: send startup errors to cerr, not log X-Git-Tag: v13.0.2~78^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=148105046dc56c003eca739659c5fd0805b2be8e;p=ceph.git global/global_init: send startup errors to cerr, not log (Flush the log, too, as something that has useful error messages.) Signed-off-by: Sage Weil --- diff --git a/src/global/global_init.cc b/src/global/global_init.cc index a7b103da4994..a990d5d3e7d6 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -114,24 +114,25 @@ void global_pre_init( int ret = conf->parse_config_files(c_str_or_null(conf_file_list), &cerr, flags); if (ret == -EDOM) { - dout_emergency("global_init: error parsing config file.\n"); + cct->_log->flush(); + cerr << "global_init: error parsing config file." << std::endl; _exit(1); } else if (ret == -ENOENT) { if (!(flags & CINIT_FLAG_NO_DEFAULT_CONFIG_FILE)) { if (conf_file_list.length()) { - ostringstream oss; - oss << "global_init: unable to open config file from search list " - << conf_file_list << "\n"; - dout_emergency(oss.str()); + cct->_log->flush(); + cerr << "global_init: unable to open config file from search list " + << conf_file_list << std::endl; _exit(1); } else { - derr << "did not load config file, using default settings." << dendl; + cerr << "did not load config file, using default settings." << std::endl; } } } else if (ret) { - dout_emergency("global_init: error reading config file.\n"); + cct->_log->flush(); + cerr << "global_init: error reading config file." << std::endl; _exit(1); } @@ -147,8 +148,9 @@ void global_pre_init( MonClient mc_bootstrap(g_ceph_context); if (mc_bootstrap.get_monmap_and_config() < 0) { - derr << "failed to fetch mon config (--no-mon-config to skip)" << dendl; cct->_log->flush(); + cerr << "failed to fetch mon config (--no-mon-config to skip)" + << std::endl; _exit(1); } }