glusterfs: Patch upstream bug preventing glusterfind from running.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1489610

Also add patch to correctly log stderr from remote nodes
when glusterfind fails.
This, too, should be removed when fixed upstream.

+79
+3
pkgs/tools/filesystems/glusterfs/default.nix
··· 73 73 ./glusterfs-use-PATH-instead-of-hardcodes.patch 74 74 ./glusterfs-fix-unsubstituted-autoconf-macros.patch 75 75 ./glusterfs-python-remove-find_library.patch 76 + # Remove when https://bugzilla.redhat.com/show_bug.cgi?id=1489610 is fixed 77 + ./glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch 78 + ./glusterfs-glusterfind-log-remote-node_cmd-error.patch 76 79 ]; 77 80 78 81 # Note that the VERSION file is something that is present in release tarballs
+27
pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch
··· 1 + From 965eb1e08e10ff82bb91d485dc24672acc7c72cf Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me> 3 + Date: Fri, 8 Sep 2017 00:51:53 +0200 4 + Subject: [PATCH] Fix "glusterfind saves var data under $prefix instead of 5 + localstatedir". Fixes #1489610 6 + 7 + Change-Id: I6d71297fb7a5a9d12cc3726b4a4ad94efcd644f9 8 + --- 9 + configure.ac | 2 +- 10 + 1 file changed, 1 insertion(+), 1 deletion(-) 11 + 12 + diff --git a/configure.ac b/configure.ac 13 + index 0c3a38689..d508fda71 100644 14 + --- a/configure.ac 15 + +++ b/configure.ac 16 + @@ -1057,7 +1057,7 @@ if test "x$prefix" = xNONE; then 17 + prefix=$ac_default_prefix 18 + fi 19 + GLUSTERFS_LIBEXECDIR="$(eval echo $prefix)/libexec/glusterfs" 20 + -GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd" 21 + +GLUSTERFSD_MISCDIR="$(eval echo $localstatedir)/var/lib/misc/glusterfsd" 22 + prefix=$old_prefix 23 + 24 + ### Dirty hacky stuff to make LOCALSTATEDIR work 25 + -- 26 + 2.12.0 27 +
+49
pkgs/tools/filesystems/glusterfs/glusterfs-glusterfind-log-remote-node_cmd-error.patch
··· 1 + From 92a6b84a37e7e2e0ec0655ca45cedb64ab72080e Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me> 3 + Date: Fri, 8 Sep 2017 02:40:01 +0200 4 + Subject: [PATCH] glusterfind: Log remote stderr on `node_cmd` error. 5 + 6 + The problem of lost stderr was introduced in 7 + commit feea851fad4f89b48bfe89fe3b75250cc7bd6501. 8 + 9 + Change-Id: Ic98f9bc9682ae3bd9c3ebea3855667fc8ba2843d 10 + --- 11 + tools/glusterfind/src/main.py | 17 ++++++++++++++++- 12 + 1 file changed, 16 insertions(+), 1 deletion(-) 13 + 14 + diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py 15 + index c125f970a..6fffce4b3 100644 16 + --- a/tools/glusterfind/src/main.py 17 + +++ b/tools/glusterfind/src/main.py 18 + @@ -75,12 +75,27 @@ def node_cmd(host, host_uuid, task, cmd, args, opts): 19 + cmd = ["ssh", 20 + "-oNumberOfPasswordPrompts=0", 21 + "-oStrictHostKeyChecking=no", 22 + + # We force TTY allocation (-t -t) so that Ctrl+C is handed 23 + + # through; see: 24 + + # https://bugzilla.redhat.com/show_bug.cgi?id=1382236 25 + + # Note that this turns stderr of the remote `cmd` 26 + + # into stdout locally. 27 + "-t", 28 + "-t", 29 + "-i", pem_key_path, 30 + "root@%s" % host] + cmd 31 + 32 + - execute(cmd, exit_msg="%s - %s failed" % (host, task), logger=logger) 33 + + (returncode, err, out) = execute(cmd, logger=logger) 34 + + if returncode != 0: 35 + + # Because the `-t -t` above turns the remote stderr into 36 + + # local stdout, we need to log both stderr and stdout 37 + + # here to print all error messages. 38 + + fail("%s - %s failed; stdout (including remote stderr):\n" 39 + + "%s\n" 40 + + "stderr:\n" 41 + + "%s" % (host, task, out, err), 42 + + returncode, 43 + + logger=logger) 44 + 45 + if opts.get("copy_outfile", False) and not localdir: 46 + cmd_copy = ["scp", 47 + -- 48 + 2.12.0 49 +