From: Xiubo Li Date: Fri, 13 Nov 2020 08:08:31 +0000 (+0800) Subject: global: reexpand the conf meta in all the child processes X-Git-Tag: v14.2.17~67^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1d6dedca3f2ff8c3571960694ab972af2a2c5b8;p=ceph.git global: reexpand the conf meta in all the child processes Especially for the tools or the daemons whose config options need to expand the '$pid', they will be always expanded with the parent processes. We need to reexpand them in child processes just after the fork is done. Fixes: https://tracker.ceph.com/issues/48240 Signed-off-by: Xiubo Li (cherry picked from commit 73a48dfe8ed165cb6c8295a88f133acb30e7065e) Conflicts: PendingReleaseNotes --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index acbe6dcc4297..fff5c5d6d3cd 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -1,25 +1,6 @@ -14.2.16 +14.2.17 ------- -* The structured output of ``ceph status`` or ``ceph -s`` is now more - concise, particularly the ``mgrmap`` and ``monmap`` sections, and the - structure of the ``osdmap`` section has been cleaned up. - -* MON: The cluster log now logs health detail every ``mon_health_to_clog_interval``, - which has been changed from 1hr to 10min. Logging of health detail will be - skipped if there is no change in health summary since last known. - - -14.2.15 -------- - -* MGR: progress module can now be turned on/off, using the commands: - ``ceph progress on`` and ``ceph progress off``. - - -14.2.13 -------- - -* This release fixes a regression introduced in 14.2.12 which broke deployments - that referred to MON hosts using DNS names instead of IP addresses in the - ``mon_host`` parameter in ``/etc/ceph/ceph.conf``. +* $pid expansion in config paths like `admin_socket` will now properly expand + to the daemon pid for commands like `ceph-mds` or `ceph-osd`. Previously only + `ceph-fuse`/`rbd-nbd` expanded `$pid` with the actual daemon pid. diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 9d6141c1eaa4..8b8292c2ace9 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -167,9 +167,8 @@ int main(int argc, const char **argv, const char *envp[]) { } { - g_ceph_context->_conf.finalize_reexpand_meta(); common_init_finish(g_ceph_context); - + init_async_signal_handler(); register_async_signal_handler(SIGHUP, sighup_handler); diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 8f6a60f54ebe..7ab7e0110fb9 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -480,6 +480,9 @@ int reopen_as_null(CephContext *cct, int fd) void global_init_postfork_start(CephContext *cct) { + // reexpand the meta in child process + cct->_conf.finalize_reexpand_meta(); + // restart log thread cct->_log->start(); cct->notify_post_fork(); diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index a2e5fdeebfb3..42dc92ad866d 100644 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@ -1159,7 +1159,6 @@ static int do_map(int argc, const char *argv[], Config *cfg) global_init_postfork_start(g_ceph_context); } - g_ceph_context->_conf.finalize_reexpand_meta(); common_init_finish(g_ceph_context); global_init_chdir(g_ceph_context);