summaryrefslogtreecommitdiffstats
path: root/src/global
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-20 01:27:34 +0200
committerSage Weil <sage@inktank.com>2013-06-20 04:44:45 +0200
commit716fc3501ac6655c47e86fbb31d57e5afd8d0240 (patch)
treef64ccd45cd47e30c9b042e0f0af7875f21f8892c /src/global
parentceph-disk: use unix lock instead of lockfile class (diff)
downloadceph-716fc3501ac6655c47e86fbb31d57e5afd8d0240.tar.xz
ceph-716fc3501ac6655c47e86fbb31d57e5afd8d0240.zip
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 <sage@inktank.com>
Diffstat (limited to 'src/global')
-rw-r--r--src/global/global_init.cc5
1 files changed, 3 insertions, 2 deletions
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();
}