]> git.apps.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)
committerXiubo Li <xiubli@redhat.com>
Mon, 23 Nov 2020 06:07:07 +0000 (14:07 +0800)
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>
PendingReleaseNotes
src/ceph_fuse.cc
src/global/global_init.cc
src/tools/rbd_nbd/rbd-nbd.cc

index 4684d9d03d3c83be1f33e1a8f9a22e23f20cd67a..ddf39e300b6447e47c211e6d12a06b32c9f38ca4 100644 (file)
@@ -1,5 +1,9 @@
 >=16.0.0
 --------
+* $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.
+
 * The allowable options for some "radosgw-admin" commands have been changed.
 
   * "mdlog-list", "datalog-list", "sync-error-list" no longer accepts
index 1529ec2322e89c0196d92878c1412991dc7029af..b7f8a4d4b90197879f6972e2cf9fa32d9d7816f5 100644 (file)
@@ -179,9 +179,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 3387a0e55bda2525b9efb4262aed95ee7cbe13cc..32e36d45fe79bcf33bc63c29536a827b1a7a1e53 100644 (file)
@@ -515,6 +515,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 11ccdf0e4b4db5a35538560a99f7f3cfe0b1ec9c..d2e11405f8d1ff852c15eac09a71591077433062 100644 (file)
@@ -1594,7 +1594,6 @@ static int do_map(int argc, const char *argv[], Config *cfg, bool reconnect)
     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);