From 19e854cf367a35f15f0aaa9e5e2e3926009c51a2 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 12 Aug 2024 10:56:51 -0400 Subject: [PATCH] mgr/cephadm: enable the smb service to prevent stray ctdb services Tell cephadm that any `ctdb` services are "owned" by the smb service and should be ignored as not a stray. Ideally, we do this on a per service basis but the info that the ctdb lock helper provides to its registration function is pretty generic. Future versions of samba may improve upon this. Signed-off-by: John Mulligan --- src/pybind/mgr/cephadm/services/smb.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pybind/mgr/cephadm/services/smb.py b/src/pybind/mgr/cephadm/services/smb.py index 0a5b62a9aca5d..7b6f7497bf1b4 100644 --- a/src/pybind/mgr/cephadm/services/smb.py +++ b/src/pybind/mgr/cephadm/services/smb.py @@ -91,6 +91,23 @@ class SMBService(CephService): # data path access. return AuthEntity(f'client.{self.TYPE}.config.{daemon_id}') + def ignore_possible_stray( + self, service_type: str, daemon_id: str, name: str + ) -> bool: + """Called to decide if a possible stray service should be ignored + because it "virtually" belongs to a service. + This is mainly needed when properly managed services spawn layered ceph + services with different names (for example). + """ + if service_type == 'ctdb': + # in the future it would be good if the ctdb service registered + # with a name/key we could associate with a cephadm deployed smb + # service (or not). But for now we just suppress the stray service + # warning for all ctdb lock helpers using the cluster + logger.debug('ignoring possibly stray ctdb service: %s', name) + return True + return False + def _allow_config_key_command(self, name: str) -> str: # permit the samba container config access to the mon config key store # with keys like smb/config//*. -- 2.39.5