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

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).