Github messages for voidlinux
 help / color / mirror / Atom feed
From: andry-dev <andry-dev@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Samba: add clustering functionality.
Date: Sun, 20 Dec 2020 23:42:27 +0100	[thread overview]
Message-ID: <20201220224227.YMUIuDuvG7Q11lmXZ9gF3JwPobiBQSm-CUu8tJYzIK4@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27300@inbox.vuxu.org>

[-- 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}"

  parent reply	other threads:[~2020-12-20 22:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 13:41 [PR PATCH] " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201220224227.YMUIuDuvG7Q11lmXZ9gF3JwPobiBQSm-CUu8tJYzIK4@z \
    --to=andry-dev@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).