Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Samba: add clustering functionality.
@ 2020-12-20 13:41 andry-dev
  2020-12-20 14:25 ` [PR PATCH] [Updated] " andry-dev
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 13:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]

There is a new pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 5284 bytes --]

From dde0de98caaa4226643dfe9120db9641a6debe02 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH] Samba: add clustering functionality.

---
 common/shlibs                               |  5 +++
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 +
 srcpkgs/samba/files/ctdbd/run               |  2 +
 srcpkgs/samba/patches/missing-headers.patch | 14 +++++++
 srcpkgs/samba/template                      | 44 ++++++++++++++++++++-
 6 files changed, 66 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..bfc023a859b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4018,6 +4018,10 @@ libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
 libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
+libtorture-samba4.so samba-4.13.2_1
+libsmbldaphelper-samba4.so samba-4.13.2_1
+libidmap-samba4.so samba-4.13.2_1
+libnss-info-samba4.so samba-4.13.2_1
 libcli-ldap-samba4.so samba-libs-4.13.2_1
 libcliauth-samba4.so samba-libs-4.13.2_1
 libcluster-samba4.so samba-libs-4.13.2_1
@@ -4049,3 +4053,4 @@ libtdb-wrap-samba4.so samba-libs-4.13.2_1
 libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
+libctdb-event-client-samba4.so ctdb-4.13.2_1
diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..e1b8058999a 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,13 +14,14 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel glusterfs-devel"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
@@ -125,6 +126,45 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		_tools="ctdb ctdbd ctdbd_wrapper ctdb_diagnostics ctdb_local_daemons ctdb_run_tests ctdb_run_cluster_tests"
+
+		for _t in ${_tools}; do
+			vmove usr/bin/${_t}
+		done
+
+		_man1="ctdb ctdb_diagnostics ctdbd ctdbd_wrapper"
+
+		for _f in ${_man1}; do
+			vmove usr/share/man/man1/${_f}.1
+		done
+
+		_man5="ctdb.conf ctdb-script.options ctdb.sysconfig"
+
+		for _f in ${_man5}; do
+			vmove usr/share/man/man5/${_f}.5
+		done
+
+		_man7="ctdb ctdb-statistics ctdb-tunables"
+
+		for _f in ${_man7}; do
+			vmove usr/share/man/man7/${_f}.7
+		done
+
+		vmove usr/lib/libctdb-event-client-samba4.so
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
@ 2020-12-20 14:25 ` andry-dev
  2020-12-20 14:46 ` ericonr
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 14:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

There is an updated pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 5138 bytes --]

From 365cd7b94f26545b99c746427f688aea032aef7a Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH] Samba: add clustering functionality.

---
 common/shlibs                               |  5 +++
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 +
 srcpkgs/samba/files/ctdbd/run               |  2 +
 srcpkgs/samba/patches/missing-headers.patch | 14 +++++++
 srcpkgs/samba/template                      | 46 ++++++++++++++++++++-
 6 files changed, 69 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..bfc023a859b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4018,6 +4018,10 @@ libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
 libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
+libtorture-samba4.so samba-4.13.2_1
+libsmbldaphelper-samba4.so samba-4.13.2_1
+libidmap-samba4.so samba-4.13.2_1
+libnss-info-samba4.so samba-4.13.2_1
 libcli-ldap-samba4.so samba-libs-4.13.2_1
 libcliauth-samba4.so samba-libs-4.13.2_1
 libcluster-samba4.so samba-libs-4.13.2_1
@@ -4049,3 +4053,4 @@ libtdb-wrap-samba4.so samba-libs-4.13.2_1
 libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
+libctdb-event-client-samba4.so ctdb-4.13.2_1
diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..69dcbd46de8 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,6 +14,7 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
@@ -33,6 +34,10 @@ make_dirs="/etc/samba/private 0750 root root"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	makedepends+=" musl-legacy-compat"
+else
+	# glusterfs is not supported with musl
+	# The VFS can only be built with glibc
+	makedepends+=" glusterfs-devel"
 fi
 
 # By default, samba wants to install a bunch of private "*-samba4.so" shared
@@ -125,6 +130,45 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		_tools="ctdb ctdbd ctdbd_wrapper ctdb_diagnostics ctdb_local_daemons ctdb_run_tests ctdb_run_cluster_tests"
+
+		for _t in ${_tools}; do
+			vmove usr/bin/${_t}
+		done
+
+		_man1="ctdb ctdb_diagnostics ctdbd ctdbd_wrapper"
+
+		for _f in ${_man1}; do
+			vmove usr/share/man/man1/${_f}.1
+		done
+
+		_man5="ctdb.conf ctdb-script.options ctdb.sysconfig"
+
+		for _f in ${_man5}; do
+			vmove usr/share/man/man5/${_f}.5
+		done
+
+		_man7="ctdb ctdb-statistics ctdb-tunables"
+
+		for _f in ${_man7}; do
+			vmove usr/share/man/man7/${_f}.7
+		done
+
+		vmove usr/lib/libctdb-event-client-samba4.so
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
  2020-12-20 14:25 ` [PR PATCH] [Updated] " andry-dev
@ 2020-12-20 14:46 ` ericonr
  2020-12-20 14:57 ` [PR PATCH] [Updated] " andry-dev
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-20 14:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748617168

Comment:
> EDIT: So it seems that glusterfs doesn't work on -musl, can I enable it only for glibc builds?

Yes, but I would make it a build option that gets added to `build_options_default` if `XBPS_TARGET_LIBC` is `glibc`.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
  2020-12-20 14:25 ` [PR PATCH] [Updated] " andry-dev
  2020-12-20 14:46 ` ericonr
@ 2020-12-20 14:57 ` andry-dev
  2020-12-20 15:02 ` [PR REVIEW] " andry-dev
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 14:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

There is an updated pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 5901 bytes --]

From dd965f8710f1e72fb3acfb7c629ad9fe29e2585d Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH] Samba: add clustering functionality.

---
 common/shlibs                               |  5 +++
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 +
 srcpkgs/samba/files/ctdbd/run               |  2 +
 srcpkgs/samba/patches/missing-headers.patch | 14 ++++++
 srcpkgs/samba/template                      | 50 ++++++++++++++++++++-
 6 files changed, 72 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..bfc023a859b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4018,6 +4018,10 @@ libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
 libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
+libtorture-samba4.so samba-4.13.2_1
+libsmbldaphelper-samba4.so samba-4.13.2_1
+libidmap-samba4.so samba-4.13.2_1
+libnss-info-samba4.so samba-4.13.2_1
 libcli-ldap-samba4.so samba-libs-4.13.2_1
 libcliauth-samba4.so samba-libs-4.13.2_1
 libcluster-samba4.so samba-libs-4.13.2_1
@@ -4049,3 +4053,4 @@ libtdb-wrap-samba4.so samba-libs-4.13.2_1
 libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
+libctdb-event-client-samba4.so ctdb-4.13.2_1
diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..ea2da3ff4b1 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,13 +14,14 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel $(vopt_if gluster_vfs glusterfs-devel)"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
@@ -30,9 +31,15 @@ checksum=276464396a05d88b775bda01ac2eb1e5a636ccf7010b0fd28efc3d85583af2b4
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
 make_dirs="/etc/samba/private 0750 root root"
+build_options="gluster_vfs"
+desc_option_gluster_vfs="Enable support for the GlusterFS VFS"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	makedepends+=" musl-legacy-compat"
+else
+	# glusterfs is not supported with musl
+	# The VFS can only be built with glibc
+	build_options_default="gluster_vfs"
 fi
 
 # By default, samba wants to install a bunch of private "*-samba4.so" shared
@@ -125,6 +132,45 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		_tools="ctdb ctdbd ctdbd_wrapper ctdb_diagnostics ctdb_local_daemons ctdb_run_tests ctdb_run_cluster_tests"
+
+		for _t in ${_tools}; do
+			vmove usr/bin/${_t}
+		done
+
+		_man1="ctdb ctdb_diagnostics ctdbd ctdbd_wrapper"
+
+		for _f in ${_man1}; do
+			vmove usr/share/man/man1/${_f}.1
+		done
+
+		_man5="ctdb.conf ctdb-script.options ctdb.sysconfig"
+
+		for _f in ${_man5}; do
+			vmove usr/share/man/man5/${_f}.5
+		done
+
+		_man7="ctdb ctdb-statistics ctdb-tunables"
+
+		for _f in ${_man7}; do
+			vmove usr/share/man/man7/${_f}.7
+		done
+
+		vmove usr/lib/libctdb-event-client-samba4.so
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (2 preceding siblings ...)
  2020-12-20 14:57 ` [PR PATCH] [Updated] " andry-dev
@ 2020-12-20 15:02 ` andry-dev
  2020-12-20 15:16 ` ericonr
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 15:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

New review comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546388083

Comment:
@ericonr would this work fine or should I change something?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (3 preceding siblings ...)
  2020-12-20 15:02 ` [PR REVIEW] " andry-dev
@ 2020-12-20 15:16 ` ericonr
  2020-12-20 15:19 ` andry-dev
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ericonr @ 2020-12-20 15:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546390096

Comment:
Looks reasonable to me.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (4 preceding siblings ...)
  2020-12-20 15:16 ` ericonr
@ 2020-12-20 15:19 ` andry-dev
  2020-12-20 16:48 ` ahesford
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 15:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New review comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546390539

Comment:
Ok, thank you!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (5 preceding siblings ...)
  2020-12-20 15:19 ` andry-dev
@ 2020-12-20 16:48 ` ahesford
  2020-12-20 16:48 ` ahesford
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546400343

Comment:
Please try adding `ctdb-event-client` to the `_privlibs` list to see if this will build without adding another unversioned shared library that we need to track.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (6 preceding siblings ...)
  2020-12-20 16:48 ` ahesford
@ 2020-12-20 16:48 ` ahesford
  2020-12-20 16:48 ` ahesford
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546400484

Comment:
Is `vmove "usr/bin/ctdb*"` sufficient here?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (7 preceding siblings ...)
  2020-12-20 16:48 ` ahesford
@ 2020-12-20 16:48 ` ahesford
  2020-12-20 16:48 ` ahesford
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546401054

Comment:
Is it appropriate for package updates to clobber everything in `/etc/ctdb`, or should some of the files in `/etc/ctdb` be marked as `conf_files`?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (9 preceding siblings ...)
  2020-12-20 16:48 ` ahesford
@ 2020-12-20 16:48 ` ahesford
  2020-12-20 18:05 ` ahesford
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546401201

Comment:
Does this really have a hard dependency on `samba`? Is this automatically picked up by shlib dependency resolution?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (8 preceding siblings ...)
  2020-12-20 16:48 ` ahesford
@ 2020-12-20 16:48 ` ahesford
  2020-12-20 16:48 ` ahesford
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546400933

Comment:
Is it sufficient to do
```bash
for _man in man1 man5 man7; do
	vmove "usr/share/man/${_man}/ctdb*"
done
```
in place of this whole block?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (10 preceding siblings ...)
  2020-12-20 16:48 ` ahesford
@ 2020-12-20 18:05 ` ahesford
  2020-12-20 19:41 ` andry-dev
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 18:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748640574

Comment:
Also, please incorporate https://github.com/ahesford/void-packages/commit/6efd1c04f46a62b1e96a33c30dda95b98c6a3a6b. I noticed some typos in the `_privlib` list and was able to drop a few more private shared libs. I've tested your changes (with my suggestions) against my cleanup and everything seems to build.

You should not need to modify `common/shlibs` when you adopt my suggestions; `xbps-src` warns about some unlisted libraries but, since they are intended to be private, they do not need to be described in the master list. The other private libraries are only included to satisfy interdependencies between the various samba subpackages.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (11 preceding siblings ...)
  2020-12-20 18:05 ` ahesford
@ 2020-12-20 19:41 ` andry-dev
  2020-12-20 20:55 ` ahesford
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 19:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

New comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748651825

Comment:
Thank you for your feedback. Right now I'm not at home; I'll integrate your changes ASAP.


Just to get the last part right: I'll remove all my changes to `common/shlibs`, cherry-pick the commit from your repo and rebase my changes on top of that one, right?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (12 preceding siblings ...)
  2020-12-20 19:41 ` andry-dev
@ 2020-12-20 20:55 ` ahesford
  2020-12-20 21:38 ` [PR REVIEW] " andry-dev
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 20:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748669618

Comment:
Yes, and don't forget to add `ctdb-event-client` to the `_privlibs` list, which means you won't need it in `common/shlibs` and you can drop the `vmove usr/lib/libctdb-event-client-samba4.so` in your new sub package as well.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (13 preceding siblings ...)
  2020-12-20 20:55 ` ahesford
@ 2020-12-20 21:38 ` andry-dev
  2020-12-20 22:21 ` andry-dev
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 21:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

New review comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546439802

Comment:
Yes, it needs to depend on `samba` because `ctdbd` spawns `smbd` processes and manages them. `ctdb` can also be configured to manage a `smb.conf`. It seems to me that dependencies are properly tracked, if I try to remove `samba` it doesn't work:
```
$ sudo xbps-remove samba
samba-4.13.2_2 in transaction breaks installed pkg `ctdb-4.13.2_2'
samba-4.13.2_2 in transaction breaks installed pkg `samba-devel-4.13.2_2'
samba-4.13.2_2 in transaction breaks installed pkg `samba-python3-4.13.2_2'
Transaction aborted due to unresolved dependencies.
```

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (14 preceding siblings ...)
  2020-12-20 21:38 ` [PR REVIEW] " andry-dev
@ 2020-12-20 22:21 ` andry-dev
  2020-12-20 22:22 ` [PR PATCH] [Updated] " andry-dev
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 22:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

New review comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546442297

Comment:
The files under `/etc/ctdb`, other than `ctdb.conf` and `nodes`, are scripts used for administering ctdb.

Now that I think about it, those scripts should probably go under `mutable_files`.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (15 preceding siblings ...)
  2020-12-20 22:21 ` andry-dev
@ 2020-12-20 22:22 ` andry-dev
  2020-12-20 22:42 ` andry-dev
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 22:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

There is an updated pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 11121 bytes --]

From 2458d8dbcdfc904925a9e98fd3759eaf1e90a0c1 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sun, 20 Dec 2020 12:31:09 -0500
Subject: [PATCH 1/2] samba: clean up private libraries

---
 common/shlibs          | 37 ++++++++++++++-----------------------
 srcpkgs/samba/template | 21 ++++++++++-----------
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..09cf603bb12 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3997,55 +3997,46 @@ libevemu.so.3 evemu-2.7.0_1
 libantilib.so.1 libantimicrox-3.1.2_1
 libinih.so.0 inih-52_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.2_1
-libdcerpc-samba4.so samba-4.13.2_1
 libdcerpc-samr.so.0 samba-4.13.2_1
 libdcerpc-server-core.so.0 samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.2_1
 libnetapi.so.0 samba-4.13.2_1
 libnss_winbind.so.2 samba-4.13.2_1
 libnss_wins.so.2 samba-4.13.2_1
+libsamba-policy.so.0 samba-4.13.2_1
+libauth-unix-token-samba4.so samba-4.13.2_1
+libdcerpc-samba4.so samba-4.13.2_1
+libdsdb-module-samba4.so samba-4.13.2_1
+libgpext-samba4.so samba-4.13.2_1
 libposix-eadb-samba4.so samba-4.13.2_1
 libprinting-migrate-samba4.so samba-4.13.2_1
 libsamba-net-samba4.so samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.2_1
 libshares-samba4.so samba-4.13.2_1
 libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.2_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
 libdcerpc.so.0 samba-libs-4.13.2_1
 libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.2_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.2_1
 libndr-krb5pac.so.0 samba-libs-4.13.2_1
 libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
 libndr-standard.so.0 samba-libs-4.13.2_1
 libndr.so.1 samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.2_1
 libsamba-credentials.so.0 samba-libs-4.13.2_1
 libsamba-errors.so.1 samba-libs-4.13.2_1
 libsamba-hostconfig.so.0 samba-libs-4.13.2_1
 libsamba-passdb.so.0 samba-libs-4.13.2_1
 libsamba-util.so.0 samba-libs-4.13.2_1
 libsamdb.so.0 samba-libs-4.13.2_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
 libsmbclient.so.0 samba-libs-4.13.2_1
 libsmbconf.so.0 samba-libs-4.13.2_1
 libsmbldap.so.2 samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.2_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
+libcli-ldap-samba4.so samba-libs-4.13.2_1
+libcliauth-samba4.so samba-libs-4.13.2_1
+libcommon-auth-samba4.so samba-libs-4.13.2_1
+libdcerpc-samba-samba4.so samba-libs-4.13.2_1
+libgpo-samba4.so samba-libs-4.13.2_1
+libndr-samba-samba4.so samba-libs-4.13.2_1
+libndr-samba4.so samba-libs-4.13.2_1
+libsmb-transport-samba4.so samba-libs-4.13.2_1
+libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..71a28a1ba1d 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -41,16 +41,16 @@ fi
 # that shouldn't be exposed locally. For those that cannot be built in, make
 # sure to install them into /usr/lib so xbps-src picks them up.
 _privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth dbwrap \
- events flag-mapping genrand gensec gse http interfaces iov-buf krb5samba \
+ asn1util auth auth4 authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
+ cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns cluster common-auth \
+ dbwrap events flag_mapping genrand gensec gse http interfaces iov_buf krb5samba \
  ldbsamba libcli_lsa3 libcli_netlogon3 libsmb messages_dgm messages_util mscat \
- msghdr msrpc3 netif npa_tstream popt_samba3 popt_samba3_cmdline \
- printer-driver registry replace samba-cluster-support samba-debug \
+ msghdr msrpc3 netif net_keytab npa_tstream popt_samba3 popt_samba3_cmdline \
+ printer_driver registry replace samba-cluster-support samba-debug \
  samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking \
- sys_rw talloc_report_printf talloc_report tdb_wrap time-basic trusts_util \
- util_reg util_setid util_tdb tevent-util"
+ server_id_db server-role samba_python smbclient-raw smbd_shim smbpasswdparser \
+ socket-blocking sys_rw talloc_report_printf talloc_report tdb-wrap tevent-util \
+ time-basic torture trusts_util util_reg util_setid util_tdb"
 configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
@@ -134,9 +134,8 @@ samba-libs_package() {
 		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
 		 samba-credentials samba-errors samba-hostconfig samba-passdb
 		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_privlibs="cli-ldap cliauth common-auth dcerpc-samba gpo
+		 ndr-samba ndr smb-transport util-cmdline winbind-client"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"

From 4ea2a31ce61aea51efbc684c4e5a170441e1dba8 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH 2/2] samba: add clustering functionality.

---
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 ++
 srcpkgs/samba/files/ctdbd/run               |  2 ++
 srcpkgs/samba/patches/missing-headers.patch | 14 ++++++++
 srcpkgs/samba/template                      | 36 ++++++++++++++++++---
 5 files changed, 51 insertions(+), 4 deletions(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 71a28a1ba1d..4d0b7af8fd1 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,13 +14,14 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel $(vopt_if gluster_vfs glusterfs-devel)"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
@@ -28,11 +29,18 @@ homepage="http://www.samba.org"
 distfiles="http://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
 checksum=276464396a05d88b775bda01ac2eb1e5a636ccf7010b0fd28efc3d85583af2b4
 lib32disabled=yes
-conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
+conf_files="/etc/pam.d/samba /etc/samba/smb.conf /etc/ctdb/ctdb.conf /etc/ctdb/nodes"
+mutable_files="/etc/sudoers.d/ctdb /etc/ctdb/*.sh /etc/ctdb/functions /etc/ctdb/events/*"
 make_dirs="/etc/samba/private 0750 root root"
+build_options="gluster_vfs"
+desc_option_gluster_vfs="Enable support for the GlusterFS VFS"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	makedepends+=" musl-legacy-compat"
+else
+	# glusterfs is not supported with musl
+	# The VFS can only be built with glibc
+	build_options_default="gluster_vfs"
 fi
 
 # By default, samba wants to install a bunch of private "*-samba4.so" shared
@@ -125,6 +133,25 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		vmove "usr/bin/ctdb*"
+
+		for _man in man1 man5 man7; do
+			vmove "usr/share/man/${_man}/ctdb*"
+		done
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"
@@ -135,7 +162,8 @@ samba-libs_package() {
 		 samba-credentials samba-errors samba-hostconfig samba-passdb
 		 samba-util samdb smbclient smbconf smbldap wbclient"
 		_privlibs="cli-ldap cliauth common-auth dcerpc-samba gpo
-		 ndr-samba ndr smb-transport util-cmdline winbind-client"
+		 ndr-samba ndr smb-transport util-cmdline winbind-client
+		 ctdb-event-client"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (16 preceding siblings ...)
  2020-12-20 22:22 ` [PR PATCH] [Updated] " andry-dev
@ 2020-12-20 22:42 ` andry-dev
  2020-12-20 22:58 ` andry-dev
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 22:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

There is an updated pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 11324 bytes --]

From 2458d8dbcdfc904925a9e98fd3759eaf1e90a0c1 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sun, 20 Dec 2020 12:31:09 -0500
Subject: [PATCH 1/2] samba: clean up private libraries

---
 common/shlibs          | 37 ++++++++++++++-----------------------
 srcpkgs/samba/template | 21 ++++++++++-----------
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..09cf603bb12 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3997,55 +3997,46 @@ libevemu.so.3 evemu-2.7.0_1
 libantilib.so.1 libantimicrox-3.1.2_1
 libinih.so.0 inih-52_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.2_1
-libdcerpc-samba4.so samba-4.13.2_1
 libdcerpc-samr.so.0 samba-4.13.2_1
 libdcerpc-server-core.so.0 samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.2_1
 libnetapi.so.0 samba-4.13.2_1
 libnss_winbind.so.2 samba-4.13.2_1
 libnss_wins.so.2 samba-4.13.2_1
+libsamba-policy.so.0 samba-4.13.2_1
+libauth-unix-token-samba4.so samba-4.13.2_1
+libdcerpc-samba4.so samba-4.13.2_1
+libdsdb-module-samba4.so samba-4.13.2_1
+libgpext-samba4.so samba-4.13.2_1
 libposix-eadb-samba4.so samba-4.13.2_1
 libprinting-migrate-samba4.so samba-4.13.2_1
 libsamba-net-samba4.so samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.2_1
 libshares-samba4.so samba-4.13.2_1
 libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.2_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
 libdcerpc.so.0 samba-libs-4.13.2_1
 libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.2_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.2_1
 libndr-krb5pac.so.0 samba-libs-4.13.2_1
 libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
 libndr-standard.so.0 samba-libs-4.13.2_1
 libndr.so.1 samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.2_1
 libsamba-credentials.so.0 samba-libs-4.13.2_1
 libsamba-errors.so.1 samba-libs-4.13.2_1
 libsamba-hostconfig.so.0 samba-libs-4.13.2_1
 libsamba-passdb.so.0 samba-libs-4.13.2_1
 libsamba-util.so.0 samba-libs-4.13.2_1
 libsamdb.so.0 samba-libs-4.13.2_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
 libsmbclient.so.0 samba-libs-4.13.2_1
 libsmbconf.so.0 samba-libs-4.13.2_1
 libsmbldap.so.2 samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.2_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
+libcli-ldap-samba4.so samba-libs-4.13.2_1
+libcliauth-samba4.so samba-libs-4.13.2_1
+libcommon-auth-samba4.so samba-libs-4.13.2_1
+libdcerpc-samba-samba4.so samba-libs-4.13.2_1
+libgpo-samba4.so samba-libs-4.13.2_1
+libndr-samba-samba4.so samba-libs-4.13.2_1
+libndr-samba4.so samba-libs-4.13.2_1
+libsmb-transport-samba4.so samba-libs-4.13.2_1
+libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..71a28a1ba1d 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -41,16 +41,16 @@ fi
 # that shouldn't be exposed locally. For those that cannot be built in, make
 # sure to install them into /usr/lib so xbps-src picks them up.
 _privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth dbwrap \
- events flag-mapping genrand gensec gse http interfaces iov-buf krb5samba \
+ asn1util auth auth4 authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
+ cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns cluster common-auth \
+ dbwrap events flag_mapping genrand gensec gse http interfaces iov_buf krb5samba \
  ldbsamba libcli_lsa3 libcli_netlogon3 libsmb messages_dgm messages_util mscat \
- msghdr msrpc3 netif npa_tstream popt_samba3 popt_samba3_cmdline \
- printer-driver registry replace samba-cluster-support samba-debug \
+ msghdr msrpc3 netif net_keytab npa_tstream popt_samba3 popt_samba3_cmdline \
+ printer_driver registry replace samba-cluster-support samba-debug \
  samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking \
- sys_rw talloc_report_printf talloc_report tdb_wrap time-basic trusts_util \
- util_reg util_setid util_tdb tevent-util"
+ server_id_db server-role samba_python smbclient-raw smbd_shim smbpasswdparser \
+ socket-blocking sys_rw talloc_report_printf talloc_report tdb-wrap tevent-util \
+ time-basic torture trusts_util util_reg util_setid util_tdb"
 configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
@@ -134,9 +134,8 @@ samba-libs_package() {
 		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
 		 samba-credentials samba-errors samba-hostconfig samba-passdb
 		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_privlibs="cli-ldap cliauth common-auth dcerpc-samba gpo
+		 ndr-samba ndr smb-transport util-cmdline winbind-client"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"

From 9988c3c550f843d0f8e4c82491ae70862cd1b84d Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH 2/2] samba: add clustering functionality.

---
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 ++
 srcpkgs/samba/files/ctdbd/run               |  2 ++
 srcpkgs/samba/patches/missing-headers.patch | 14 +++++++++
 srcpkgs/samba/template                      | 35 ++++++++++++++++++---
 5 files changed, 50 insertions(+), 4 deletions(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 71a28a1ba1d..63298d36d24 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,13 +14,14 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel $(vopt_if gluster_vfs glusterfs-devel)"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
@@ -28,11 +29,18 @@ homepage="http://www.samba.org"
 distfiles="http://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.gz"
 checksum=276464396a05d88b775bda01ac2eb1e5a636ccf7010b0fd28efc3d85583af2b4
 lib32disabled=yes
-conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
+conf_files="/etc/pam.d/samba /etc/samba/smb.conf /etc/ctdb/ctdb.conf /etc/ctdb/nodes"
+mutable_files="/etc/sudoers.d/ctdb /etc/ctdb/*.sh /etc/ctdb/functions /etc/ctdb/events/*"
 make_dirs="/etc/samba/private 0750 root root"
+build_options="gluster_vfs"
+desc_option_gluster_vfs="Enable support for the GlusterFS VFS"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	makedepends+=" musl-legacy-compat"
+else
+	# glusterfs is not supported with musl
+	# The VFS can only be built with glibc
+	build_options_default="gluster_vfs"
 fi
 
 # By default, samba wants to install a bunch of private "*-samba4.so" shared
@@ -50,7 +58,7 @@ _privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
  samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
  server_id_db server-role samba_python smbclient-raw smbd_shim smbpasswdparser \
  socket-blocking sys_rw talloc_report_printf talloc_report tdb-wrap tevent-util \
- time-basic torture trusts_util util_reg util_setid util_tdb"
+ time-basic torture trusts_util util_reg util_setid util_tdb ctdb-event-client"
 configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
@@ -125,6 +133,25 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		vmove "usr/bin/ctdb*"
+
+		for _man in man1 man5 man7; do
+			vmove "usr/share/man/${_man}/ctdb*"
+		done
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Updated] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (17 preceding siblings ...)
  2020-12-20 22:42 ` andry-dev
@ 2020-12-20 22:58 ` andry-dev
  2020-12-20 23:47 ` [PR REVIEW] " ahesford
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-20 22:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

There is an updated pull request by andry-dev against master on the void-packages repository

https://github.com/andry-dev/void-packages samba-gluster
https://github.com/void-linux/void-packages/pull/27300

Samba: add clustering functionality.
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

A patch file from https://github.com/void-linux/void-packages/pull/27300.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-samba-gluster-27300.patch --]
[-- Type: text/x-diff, Size: 11201 bytes --]

From 2458d8dbcdfc904925a9e98fd3759eaf1e90a0c1 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Sun, 20 Dec 2020 12:31:09 -0500
Subject: [PATCH 1/2] samba: clean up private libraries

---
 common/shlibs          | 37 ++++++++++++++-----------------------
 srcpkgs/samba/template | 21 ++++++++++-----------
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e1e2291d5f7..09cf603bb12 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3997,55 +3997,46 @@ libevemu.so.3 evemu-2.7.0_1
 libantilib.so.1 libantimicrox-3.1.2_1
 libinih.so.0 inih-52_1
 libpcaudio.so.0 pcaudiolib-1.1_1
-libauth-unix-token-samba4.so samba-4.13.2_1
-libauth4-samba4.so samba-4.13.2_1
-libdcerpc-samba4.so samba-4.13.2_1
 libdcerpc-samr.so.0 samba-4.13.2_1
 libdcerpc-server-core.so.0 samba-4.13.2_1
-libdsdb-module-samba4.so samba-4.13.2_1
-libgpext-samba4.so samba-4.13.2_1
-libnet-keytab-samba4.so samba-4.13.2_1
 libnetapi.so.0 samba-4.13.2_1
 libnss_winbind.so.2 samba-4.13.2_1
 libnss_wins.so.2 samba-4.13.2_1
+libsamba-policy.so.0 samba-4.13.2_1
+libauth-unix-token-samba4.so samba-4.13.2_1
+libdcerpc-samba4.so samba-4.13.2_1
+libdsdb-module-samba4.so samba-4.13.2_1
+libgpext-samba4.so samba-4.13.2_1
 libposix-eadb-samba4.so samba-4.13.2_1
 libprinting-migrate-samba4.so samba-4.13.2_1
 libsamba-net-samba4.so samba-4.13.2_1
-libsamba-policy.so.0 samba-4.13.2_1
-libsamba-python-samba4.so samba-4.13.2_1
 libshares-samba4.so samba-4.13.2_1
 libsmbd-base-samba4.so samba-4.13.2_1
 libsmbd-conn-samba4.so samba-4.13.2_1
-libsmbpasswdparser-samba4.so samba-4.13.2_1
 libxattr-tdb-samba4.so samba-4.13.2_1
-libcli-ldap-samba4.so samba-libs-4.13.2_1
-libcliauth-samba4.so samba-libs-4.13.2_1
-libcluster-samba4.so samba-libs-4.13.2_1
-libcommon-auth-samba4.so samba-libs-4.13.2_1
 libdcerpc.so.0 samba-libs-4.13.2_1
 libdcerpc-binding.so.0 samba-libs-4.13.2_1
-libdcerpc-samba-samba4.so samba-libs-4.13.2_1
-libflag-mapping-samba4.so samba-libs-4.13.2_1
-libgpo-samba4.so samba-libs-4.13.2_1
-libiov-buf-samba4.so samba-libs-4.13.2_1
 libndr-krb5pac.so.0 samba-libs-4.13.2_1
 libndr-nbt.so.0 samba-libs-4.13.2_1
-libndr-samba-samba4.so samba-libs-4.13.2_1
-libndr-samba4.so samba-libs-4.13.2_1
 libndr-standard.so.0 samba-libs-4.13.2_1
 libndr.so.1 samba-libs-4.13.2_1
-libprinter-driver-samba4.so samba-libs-4.13.2_1
 libsamba-credentials.so.0 samba-libs-4.13.2_1
 libsamba-errors.so.1 samba-libs-4.13.2_1
 libsamba-hostconfig.so.0 samba-libs-4.13.2_1
 libsamba-passdb.so.0 samba-libs-4.13.2_1
 libsamba-util.so.0 samba-libs-4.13.2_1
 libsamdb.so.0 samba-libs-4.13.2_1
-libsmb-transport-samba4.so samba-libs-4.13.2_1
 libsmbclient.so.0 samba-libs-4.13.2_1
 libsmbconf.so.0 samba-libs-4.13.2_1
 libsmbldap.so.2 samba-libs-4.13.2_1
-libtdb-wrap-samba4.so samba-libs-4.13.2_1
-libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwbclient.so.0 samba-libs-4.13.2_1
+libcli-ldap-samba4.so samba-libs-4.13.2_1
+libcliauth-samba4.so samba-libs-4.13.2_1
+libcommon-auth-samba4.so samba-libs-4.13.2_1
+libdcerpc-samba-samba4.so samba-libs-4.13.2_1
+libgpo-samba4.so samba-libs-4.13.2_1
+libndr-samba-samba4.so samba-libs-4.13.2_1
+libndr-samba4.so samba-libs-4.13.2_1
+libsmb-transport-samba4.so samba-libs-4.13.2_1
+libutil-cmdline-samba4.so samba-libs-4.13.2_1
 libwinbind-client-samba4.so samba-libs-4.13.2_1
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index b0612faddc6..71a28a1ba1d 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -41,16 +41,16 @@ fi
 # that shouldn't be exposed locally. For those that cannot be built in, make
 # sure to install them into /usr/lib so xbps-src picks them up.
 _privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
- asn1util auth authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
- cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns common-auth dbwrap \
- events flag-mapping genrand gensec gse http interfaces iov-buf krb5samba \
+ asn1util auth auth4 authkrb5 cmdline_contexts cmdline-credentials cli_cldap \
+ cli-ldap-common cli-nbt cli_smb_common cli_spoolss clidns cluster common-auth \
+ dbwrap events flag_mapping genrand gensec gse http interfaces iov_buf krb5samba \
  ldbsamba libcli_lsa3 libcli_netlogon3 libsmb messages_dgm messages_util mscat \
- msghdr msrpc3 netif npa_tstream popt_samba3 popt_samba3_cmdline \
- printer-driver registry replace samba-cluster-support samba-debug \
+ msghdr msrpc3 netif net_keytab npa_tstream popt_samba3 popt_samba3_cmdline \
+ printer_driver registry replace samba-cluster-support samba-debug \
  samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
- server_id_db server-role smbclient-raw smbd_shim socket-blocking \
- sys_rw talloc_report_printf talloc_report tdb_wrap time-basic trusts_util \
- util_reg util_setid util_tdb tevent-util"
+ server_id_db server-role samba_python smbclient-raw smbd_shim smbpasswdparser \
+ socket-blocking sys_rw talloc_report_printf talloc_report tdb-wrap tevent-util \
+ time-basic torture trusts_util util_reg util_setid util_tdb"
 configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
@@ -134,9 +134,8 @@ samba-libs_package() {
 		_libs="dcerpc dcerpc-binding ndr-krb5pac ndr-nbt ndr-standard ndr
 		 samba-credentials samba-errors samba-hostconfig samba-passdb
 		 samba-util samdb smbclient smbconf smbldap wbclient"
-		_privlibs="cli-ldap cliauth cluster common-auth dcerpc-samba
-		 flag-mapping gpo iov-buf ndr-samba ndr printer-driver
-		 smb-transport tdb-wrap util-cmdline winbind-client"
+		_privlibs="cli-ldap cliauth common-auth dcerpc-samba gpo
+		 ndr-samba ndr smb-transport util-cmdline winbind-client"
 
 		for _lib in ${_libs}; do
 			vmove "usr/lib/lib${_lib}.so.*"

From 1c550a03ada63290c3e41a6b97609be0133a2e98 Mon Sep 17 00:00:00 2001
From: andry-dev <andry-dev@users.noreply.github.com>
Date: Sun, 20 Dec 2020 14:20:36 +0100
Subject: [PATCH 2/2] samba: add clustering functionality.

---
 srcpkgs/ctdb                                |  1 +
 srcpkgs/samba/files/ctdbd/log/run           |  2 ++
 srcpkgs/samba/files/ctdbd/run               |  2 ++
 srcpkgs/samba/patches/missing-headers.patch | 14 +++++++++
 srcpkgs/samba/template                      | 33 +++++++++++++++++++--
 5 files changed, 49 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/ctdb
 create mode 100644 srcpkgs/samba/files/ctdbd/log/run
 create mode 100644 srcpkgs/samba/files/ctdbd/run

diff --git a/srcpkgs/ctdb b/srcpkgs/ctdb
new file mode 120000
index 00000000000..cba1f39180b
--- /dev/null
+++ b/srcpkgs/ctdb
@@ -0,0 +1 @@
+samba
\ No newline at end of file
diff --git a/srcpkgs/samba/files/ctdbd/log/run b/srcpkgs/samba/files/ctdbd/log/run
new file mode 100644
index 00000000000..7b12895c740
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice -t ctdbd
diff --git a/srcpkgs/samba/files/ctdbd/run b/srcpkgs/samba/files/ctdbd/run
new file mode 100644
index 00000000000..f93d43eb862
--- /dev/null
+++ b/srcpkgs/samba/files/ctdbd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ctdbd -i
diff --git a/srcpkgs/samba/patches/missing-headers.patch b/srcpkgs/samba/patches/missing-headers.patch
index 44a5418e0bd..a91db73b758 100644
--- a/srcpkgs/samba/patches/missing-headers.patch
+++ b/srcpkgs/samba/patches/missing-headers.patch
@@ -36,3 +36,17 @@ index 2cd6122..0c84ec2 100644
  
  #include "torture/torture.h"
  #include "torture/local/proto.h"
+ 
+diff --git ctdb/tests/src/protocol_util_test.c ctdb/tests/src/protocol_util_test.c
+index edd2a34..48ce96e 100644
+--- ctdb/tests/src/protocol_util_test.c
++++ ctdb/tests/src/protocol_util_test.c
+@@ -20,6 +20,7 @@
+ #include "replace.h"
+ #include "system/network.h"
+
++#include <unistd.h>
+ #include <assert.h>
+
+ #include "protocol/protocol_basic.c"
+
diff --git a/srcpkgs/samba/template b/srcpkgs/samba/template
index 71a28a1ba1d..5fb88c32a27 100644
--- a/srcpkgs/samba/template
+++ b/srcpkgs/samba/template
@@ -1,7 +1,7 @@
 # Template file for 'samba'
 pkgname=samba
 version=4.13.2
-revision=1
+revision=2
 build_style=waf3
 build_helper="qemu"
 configure_script="buildtools/bin/waf"
@@ -14,13 +14,14 @@ configure_args="--enable-fhs --sbindir=/usr/bin --localstatedir=/var
  --with-modulesdir=/usr/lib/samba --disable-rpath --disable-rpath-install
  --without-systemd --without-gettext --bundled-libraries=NONE
  --with-system-mitkrb5 --without-ad-dc
+ --with-cluster-support
  --with-shared-modules=${_idmap_modules},${_pdb_modules},${_auth_modules}"
 hostmakedepends="pkg-config perl-Parse-Yapp rpcsvc-proto docbook2x
  libtasn1-tools tdb-python3 tevent-python3 talloc-python3"
 makedepends="python3-devel libtirpc-devel popt-devel e2fsprogs-devel
  mit-krb5-devel pam-devel acl-devel cups-devel avahi-libs-devel tdb-devel
  talloc-devel tevent-devel ldb-devel cmocka-devel gnutls-devel zlib-devel
- ncurses-devel libldap-devel libarchive-devel jansson-devel"
+ ncurses-devel libldap-devel libarchive-devel jansson-devel $(vopt_if gluster_vfs glusterfs-devel)"
 short_desc="SMB/CIFS file, print, and login server for Unix"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later"
@@ -29,10 +30,17 @@ distfiles="http://download.samba.org/pub/samba/stable/${pkgname}-${version}.tar.
 checksum=276464396a05d88b775bda01ac2eb1e5a636ccf7010b0fd28efc3d85583af2b4
 lib32disabled=yes
 conf_files="/etc/pam.d/samba /etc/samba/smb.conf"
+mutable_files="/etc/sudoers.d/ctdb /etc/ctdb/*.sh /etc/ctdb/functions /etc/ctdb/events/*"
 make_dirs="/etc/samba/private 0750 root root"
+build_options="gluster_vfs"
+desc_option_gluster_vfs="Enable support for the GlusterFS VFS"
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 	makedepends+=" musl-legacy-compat"
+else
+	# glusterfs is not supported with musl
+	# The VFS can only be built with glibc
+	build_options_default="gluster_vfs"
 fi
 
 # By default, samba wants to install a bunch of private "*-samba4.so" shared
@@ -50,7 +58,7 @@ _privlibs="CHARSET3 MESSAGING_SEND MESSAGING LIBWBCLIENT_OLD addns ads \
  samba-modules samba-security samba-sockets samba3-util samdb-common secrets3 \
  server_id_db server-role samba_python smbclient-raw smbd_shim smbpasswdparser \
  socket-blocking sys_rw talloc_report_printf talloc_report tdb-wrap tevent-util \
- time-basic torture trusts_util util_reg util_setid util_tdb"
+ time-basic torture trusts_util util_reg util_setid util_tdb ctdb-event-client"
 configure_args+=" --with-privatelibdir=/usr/lib --builtin-libraries=${_privlibs// /,}"
 
 export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
@@ -125,6 +133,25 @@ smbclient_package() {
 	}
 }
 
+ctdb_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - Clustered TDB support"
+	pkg_install() {
+		vmove "usr/bin/ctdb*"
+
+		for _man in man1 man5 man7; do
+			vmove "usr/share/man/${_man}/ctdb*"
+		done
+
+		vmove usr/libexec/ctdb
+		vmove usr/share/ctdb
+		vmove etc/ctdb
+		vmove etc/sudoers.d/ctdb
+
+		vsv ctdbd
+	}
+}
+
 samba-libs_package() {
 	short_desc+=" - core libraries"
 	provides="libsmbclient-${version}_${revision}"

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR REVIEW] Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (18 preceding siblings ...)
  2020-12-20 22:58 ` andry-dev
@ 2020-12-20 23:47 ` ahesford
  2020-12-21  1:54 ` ahesford
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-20 23:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#discussion_r546454163

Comment:
Even if they are scripts, if you expect the user to modify them and you don't want to clobber them with every update, use `conf_files` instead of `mutable_files`. Files listed in `mutable_files` are still replaced during upgrades and removed when a package is removed, but XBPS ignores changes to the files when evaluating package integrity. Files listed in `conf_files` are removed or replaced if and only if their contents have not been changed by the user since installation time.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (19 preceding siblings ...)
  2020-12-20 23:47 ` [PR REVIEW] " ahesford
@ 2020-12-21  1:54 ` ahesford
  2020-12-21  7:17 ` andry-dev
  2020-12-21 13:06 ` [PR PATCH] [Closed]: " ahesford
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-21  1:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748714358

Comment:
I've done a little more digging into this and have made changes in my branch to address the following concerns:

1. The `ctdb` package should probably be called `samba-ctdb`. I wondered whether `ctdb` served a purpose as a standalone clustered database, but as upstream seems to think its sole purpose is to be tightly coupled with Samba, the name should probably reflect that it's a subcomponent.

2. Building with GlusterFS adds a hard dependency on `libglusterfs` for the main `samba` package. The only place this appears is in the `glusterfs.so` VFS module, so we can put this module and its man page into a separate subpackage that will allow people to avoid the dependency without requiring a custom build.

3. After review, I don't think `conf_files` or `mutable_files` are appropriate for contents of `/etc/ctdb`. The `functions` file seems to be sourced from a lot of script not intended to be edited by users (specifically, those in `/usr/share`) and probably should be considered non-editable. The `events` contents are symlinks, which don't work properly `conf_files`. I think the best option we have for these files is `noextract` rules if users want to override the default set of event scripts.

4. Some executables in `/usr/bin` related to CTDB were still left behind in the main `samba` package.

Please take a look at commit ahesford@d70038551bd0b5635ff893cc5e1b28afafd64d56 and, if you have no objections, I'll merge that one.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (20 preceding siblings ...)
  2020-12-21  1:54 ` ahesford
@ 2020-12-21  7:17 ` andry-dev
  2020-12-21 13:06 ` [PR PATCH] [Closed]: " ahesford
  22 siblings, 0 replies; 24+ messages in thread
From: andry-dev @ 2020-12-21  7:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

New comment by andry-dev on void-packages repository

https://github.com/void-linux/void-packages/pull/27300#issuecomment-748809262

Comment:
I looked at your commit and it seems fine to me. You can merge that one and close this PR.

Thank you for your time and patience!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PR PATCH] [Closed]: Samba: add clustering functionality.
  2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
                   ` (21 preceding siblings ...)
  2020-12-21  7:17 ` andry-dev
@ 2020-12-21 13:06 ` ahesford
  22 siblings, 0 replies; 24+ messages in thread
From: ahesford @ 2020-12-21 13:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

There's a closed pull request on the void-packages repository

Samba: add clustering functionality.
https://github.com/void-linux/void-packages/pull/27300

Description:
I waited for Samba 4.X to get merged to create this PR. I didn't want to interfere with the original one because it was pretty important.

This PR enables the cluster module (`ctdb`) and the GlusterFS VFS:

 - The GlusterFS VFS (`/usr/lib/samba/glusterfs_vfs.so`) is needed to improve I/O performance with GlusterFS volumes. This is enabled automatically if `waf` can find the Gluster libraries, so to make it work it's only needed to add `glusterfs-devel` in the `makedepends` for `samba` and that's it.
 - The `ctdb` module is needed to keep track of TDB across various nodes in a cluster, so that a share can be exposed as a single IP and resume operations in case of node failures. This is generally used in conjunction with Gluster, Ceph or other distributed filesystems. 

Enabling both modules doesn't break existing users since these features are opt-in: for the Gluster VFS you specifically need to enable it in a share definition (see [vfs_glusterfs(8)](https://www.samba.org/samba/docs/current/man-html/vfs_glusterfs.8.html)); for `ctdb` you need to enable and configure the daemon `ctdbd`.

EDIT: So it seems that `glusterfs` doesn't work on `-musl`, can I enable it only for `glibc` builds?

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-12-21 13:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-20 13:41 [PR PATCH] Samba: add clustering functionality andry-dev
2020-12-20 14:25 ` [PR PATCH] [Updated] " andry-dev
2020-12-20 14:46 ` ericonr
2020-12-20 14:57 ` [PR PATCH] [Updated] " andry-dev
2020-12-20 15:02 ` [PR REVIEW] " andry-dev
2020-12-20 15:16 ` ericonr
2020-12-20 15:19 ` andry-dev
2020-12-20 16:48 ` ahesford
2020-12-20 16:48 ` ahesford
2020-12-20 16:48 ` ahesford
2020-12-20 16:48 ` ahesford
2020-12-20 16:48 ` ahesford
2020-12-20 18:05 ` ahesford
2020-12-20 19:41 ` andry-dev
2020-12-20 20:55 ` ahesford
2020-12-20 21:38 ` [PR REVIEW] " andry-dev
2020-12-20 22:21 ` andry-dev
2020-12-20 22:22 ` [PR PATCH] [Updated] " andry-dev
2020-12-20 22:42 ` andry-dev
2020-12-20 22:58 ` andry-dev
2020-12-20 23:47 ` [PR REVIEW] " ahesford
2020-12-21  1:54 ` ahesford
2020-12-21  7:17 ` andry-dev
2020-12-21 13:06 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).