]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_context: re-expand admin_socket metavariables in child process 18393/head
authorZhi Zhang <willzzhang@tencent.com>
Thu, 19 Oct 2017 07:08:54 +0000 (15:08 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Mon, 23 Oct 2017 06:20:22 +0000 (14:20 +0800)
Reset admin_socket raw value if it is defined in conffile.
Just in case it used metavarirables (e.g, $pid) which could be expanded
again to the correct value in child process.

Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/common/ceph_context.cc

index 2f5256baf5479c0f58ef05de7338d29d3b0955bf..96b78e2fa2e76097d7660c39da1ea090aed75097 100644 (file)
@@ -741,6 +741,19 @@ void CephContext::start_service_thread()
   if (_conf->log_flush_on_exit)
     _log->set_flush_on_exit();
 
+  if (_conf->admin_socket.length()) {
+    // Reset admin_socket raw value if it is defined in conffile.
+    // Just in case it used metavarirables (e.g, $pid) which could be expanded 
+    // again to the correct value here in child process.
+    std::vector <std::string> my_sections;
+    std::string admin_socket;
+    _conf->get_my_sections(my_sections);
+    if (_conf->get_val_from_conf_file(my_sections, "admin_socket",
+        admin_socket, false) == 0) {
+      _conf->set_val("admin_socket", admin_socket);
+    }
+  }
+
   // Trigger callbacks on any config observers that were waiting for
   // it to become safe to start threads.
   _conf->set_val("internal_safe_to_start_threads", "true");