From 716fc3501ac6655c47e86fbb31d57e5afd8d0240 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 19 Jun 2013 16:27:34 -0700 Subject: ceph-conf: make --show-config-value reflect daemon defaults We want DAEMON defaults, but we don't want global_init to do anything else daemonish like print a banner or mkdir /var/run/ceph. This lets us use ceph-conf -n osd.0 --show-config-value log_file to get the default, while ceph-conf -n osd.0 log_file only reflects what is in the config file. Signed-off-by: Sage Weil --- src/global/global_init.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/global') diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 8363d0e191a..e96c317f820 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -120,7 +120,8 @@ void global_init(std::vector < const char * > *alt_def_args, std::vector < const g_ceph_context->_log->set_flush_on_exit(); if (g_conf->run_dir.length() && - code_env == CODE_ENVIRONMENT_DAEMON) { + code_env == CODE_ENVIRONMENT_DAEMON && + !(flags & CINIT_FLAG_NO_DAEMON_ACTIONS)) { int r = ::mkdir(g_conf->run_dir.c_str(), 0755); if (r < 0 && errno != EEXIST) { r = -errno; @@ -138,7 +139,7 @@ void global_init(std::vector < const char * > *alt_def_args, std::vector < const // and opening the log file immediately. conf->call_all_observers(); - if (code_env == CODE_ENVIRONMENT_DAEMON) + if (code_env == CODE_ENVIRONMENT_DAEMON && !(flags & CINIT_FLAG_NO_DAEMON_ACTIONS)) output_ceph_version(); } -- cgit v1.2.3