]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/common_init: use unique admin_socket path for unprivileged daemons
authorSage Weil <sage@redhat.com>
Wed, 28 Feb 2018 22:24:34 +0000 (16:24 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:50 +0000 (14:44 -0600)
These qualify as 'daemon', but their path is usually not unique.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/common_init.cc

index b365ba67ac78e2571dc4c447bc0171f11ce37909..1c306d3b98c4b164f962dfd7a9a179ae2cb60970 100644 (file)
@@ -51,6 +51,12 @@ CephContext *common_preinit(const CephInitParameters &iparams,
     conf->set_val_default("keyring", "$osd_data/keyring");
   }
 
+  if ((flags & CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS)) {
+    // make this unique despite multiple instances by the same name.
+    conf->set_val_default("admin_socket",
+                         "$run_dir/$cluster-$name.$pid.$cctid.asok");
+  }
+
   if (code_env == CODE_ENVIRONMENT_LIBRARY ||
       code_env == CODE_ENVIRONMENT_UTILITY_NODOUT) {
     conf->set_val_default("log_to_stderr", "false");