From: Zhi Zhang Date: Thu, 19 Oct 2017 07:08:54 +0000 (+0800) Subject: ceph_context: re-expand admin_socket metavariables in child process X-Git-Tag: v13.0.1~441^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1630f4bbef3a3ff6efb56acbaa9b8786b945b1e6;p=ceph.git ceph_context: re-expand admin_socket metavariables in child process 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 --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 2f5256baf547..96b78e2fa2e7 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -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 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");