From e086e7182d1a4b75fa956999d1ff10e396658090 Mon Sep 17 00:00:00 2001 From: Adam King Date: Mon, 19 Feb 2024 11:14:11 -0500 Subject: [PATCH] cephadm: create ceph-exporter sock dir if it's not present Since this is usually /var/run/ceph/ which ends up getting created by other daemons as well, it was common to see ceph-exporter fail to deploy and then deploy fine after once other daemons were down on the host. I don't see any reason we can't just try to make the directory here instead of bailing out. Fixes: https://tracker.ceph.com/issues/64491wq Signed-off-by: Adam King (cherry picked from commit 862fca945f5bf48144b6a589f1d3cd971444daf7) --- src/cephadm/cephadmlib/daemons/ceph.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadmlib/daemons/ceph.py b/src/cephadm/cephadmlib/daemons/ceph.py index a835cb477c12..e6392876cc60 100644 --- a/src/cephadm/cephadmlib/daemons/ceph.py +++ b/src/cephadm/cephadmlib/daemons/ceph.py @@ -299,8 +299,6 @@ class CephExporter(ContainerDaemonForm): self.prio_limit = config_json.get('prio-limit', 5) self.stats_period = config_json.get('stats-period', 5) - self.validate() - @classmethod def init( cls, ctx: CephadmContext, fsid: str, daemon_id: Union[int, str] @@ -371,6 +369,13 @@ class CephExporter(ContainerDaemonForm): def default_entrypoint(self) -> str: return self.entrypoint + def prepare_data_dir(self, data_dir: str, uid: int, gid: int) -> None: + if not os.path.exists(self.sock_dir): + os.mkdir(self.sock_dir) + # part of validation is for the sock dir, so we postpone + # it until now + self.validate() + def get_ceph_mounts_for_type( ctx: CephadmContext, fsid: str, daemon_type: str -- 2.47.3