]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: enable the smb service to prevent stray ctdb services
authorJohn Mulligan <phlogistonjohn@asynchrono.us>
Mon, 12 Aug 2024 14:56:51 +0000 (10:56 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 20 Aug 2024 13:53:57 +0000 (09:53 -0400)
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 <phlogistonjohn@asynchrono.us>
src/pybind/mgr/cephadm/services/smb.py

index 0a5b62a9aca5d52e4dc4cf20fa36c2ad614d58aa..7b6f7497bf1b4cde1670fdda24327a560137dd45 100644 (file)
@@ -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/<cluster_id>/*.