From: Jason Dillaman Date: Wed, 21 Aug 2019 21:20:51 +0000 (-0400) Subject: rbd-mirror: ignore errors related to parsing the config file X-Git-Tag: v15.1.0~1773^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e8c41e5f72b4f42bc87f2a8b6f45a853cc19faf;p=ceph.git rbd-mirror: ignore errors related to parsing the config file If one or more of the default search paths throw an error like -EPERM, no longer abort the attempt to connect to the cluster. Previously, after dropping privileges librados would attempt to access "/root/.ceph/.conf" and would fail due to the error, even if all the necessary data to connect was available via the mon config-key store. Fixes: https://tracker.ceph.com/issues/41356 Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc index 4cc29ea0927f..7bb98604676e 100644 --- a/src/tools/rbd_mirror/PoolReplayer.cc +++ b/src/tools/rbd_mirror/PoolReplayer.cc @@ -434,10 +434,9 @@ int PoolReplayer::init_rados(const std::string &cluster_name, // librados::Rados::conf_read_file int r = cct->_conf.parse_config_files(nullptr, nullptr, 0); if (r < 0 && r != -ENOENT) { + // do not treat this as fatal, it might still be able to connect derr << "could not read ceph conf for " << description << ": " << cpp_strerror(r) << dendl; - cct->put(); - return r; } // preserve cluster-specific config settings before applying environment/cli