]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
global: reexpand the conf meta in all the child processes
authorXiubo Li <xiubli@redhat.com>
Fri, 13 Nov 2020 08:08:31 +0000 (16:08 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 4 Dec 2020 11:21:51 +0000 (12:21 +0100)
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 <xiubli@redhat.com>
(cherry picked from commit 73a48dfe8ed165cb6c8295a88f133acb30e7065e)

Conflicts:
PendingReleaseNotes

PendingReleaseNotes
src/ceph_fuse.cc
src/global/global_init.cc
src/tools/rbd_nbd/rbd-nbd.cc

index c5fb58f63e5ca68cfc02f0d2655176bf1a66cdc7..68d4924a4b431c5e11bba2deedcd5fe1fd66ba38 100644 (file)
@@ -1,5 +1,8 @@
-15.2.6
+15.2.8
 ------
+* $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.
 
 * ceph-volume: The ``lvm batch` subcommand received a major rewrite. This closed
   a number of bugs and improves usability in terms of size specification and
index b707806b6699ec267800cb0b6ac469dc569681a5..5ae9404d89756756aedbcd4128e5af35ca46c340 100644 (file)
@@ -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);
 
index 0afeddb12a5f9bcc31937f99765424bced6efc01..d1dc4c5790a6149cd55d8f81b5be72e5298e828d 100644 (file)
@@ -494,6 +494,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();
index b720b85dff7474b4acaf39e77d6193bc405ee8a4..a2a911f40a1d1524a8c92dd5367848df93f5b43c 100644 (file)
@@ -1157,7 +1157,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);