]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm/smb: Update CTDB bind mount for new socket path 70238/head
authorAnoop C S <anoopcs@cryptolab.net>
Wed, 15 Jul 2026 18:41:13 +0000 (00:11 +0530)
committerAnoop C S <anoopcs@cryptolab.net>
Thu, 16 Jul 2026 16:51:38 +0000 (22:21 +0530)
Samba recently changed CTDB to derive its runtime paths from Samba's
configure options instead of using a monolithic CTDB_RUNDIR[1].
With current packaging[2], the CTDB socket path moved from
/var/run/ctdb/ctdbd.socket to /run/samba/ctdb/ctdbd.socket.

Update the CTDB runtime bind mount target from /var/run/ctdb to
/run/samba/ctdb to match the new CTDB_SOCKETDIR. Additionally,
create the CTDB pid directory, /run/ctdb, and lock directory,
/var/lib/samba/lock/ctdb, on the host side as they are hidden
when their parent directories are bind mounted over.

Ideally these directories should be created by sambacc but sambacc is
included in samba-container images that may be built with different
Samba packages where these path configurations might not hold true.

[1] https://gitlab.com/samba-team/samba/-/merge_requests/4631
[2] https://github.com/samba-in-kubernetes/samba-build/blob/main/packaging/samba-master.spec.j2

Fixes: https://tracker.ceph.com/issues/78309
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
src/cephadm/cephadmlib/daemons/smb.py

index 684cbbe495f0ffa0530ed212112aab53211038e1..5a49f1300c0d65dd682b07f8f78a575e660c9175 100644 (file)
@@ -43,7 +43,6 @@ from ..exceptions import Error
 from ..host_facts import list_networks
 from ..net_utils import EndPoint
 
-
 logger = logging.getLogger()
 
 # sambacc provided commands we will need (when clustered)
@@ -1004,7 +1003,7 @@ class SMB(ContainerDaemonForm):
             ctdb_volatile = str(data_dir / 'ctdb/volatile')
             ctdb_etc = str(data_dir / 'ctdb/etc')
             mounts[ctdb_persistent] = '/var/lib/ctdb/persistent:z'
-            mounts[ctdb_run] = '/var/run/ctdb:z'
+            mounts[ctdb_run] = '/run/samba/ctdb:z'
             mounts[ctdb_volatile] = '/var/lib/ctdb/volatile:z'
             mounts[ctdb_etc] = '/etc/ctdb:z'
             # create a shared smb.conf file for our clustered instances.
@@ -1071,6 +1070,8 @@ class SMB(ContainerDaemonForm):
             file_utils.makedirs(ddir / 'ctdb/run', uid, gid, 0o770)
             file_utils.makedirs(ddir / 'ctdb/volatile', uid, gid, 0o770)
             file_utils.makedirs(ddir / 'ctdb/etc', uid, gid, 0o770)
+            file_utils.makedirs(ddir / 'run/ctdb', uid, gid, 0o770)
+            file_utils.makedirs(ddir / 'lib-samba/lock/ctdb', uid, gid, 0o770)
             self._write_ctdb_stub_config(etc_samba_ctr / 'ctdb.json')
             self._write_smb_conf_stub(ddir / 'ctdb/smb.conf')
             if self._cfg.bind_to: