-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...s/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 965eb1e08e10ff82bb91d485dc24672acc7c72cf Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me> | ||
Date: Fri, 8 Sep 2017 00:51:53 +0200 | ||
Subject: [PATCH] Fix "glusterfind saves var data under $prefix instead of | ||
localstatedir". Fixes #1489610 | ||
|
||
Change-Id: I6d71297fb7a5a9d12cc3726b4a4ad94efcd644f9 | ||
--- | ||
configure.ac | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 0c3a38689..d508fda71 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -1057,7 +1057,7 @@ if test "x$prefix" = xNONE; then | ||
prefix=$ac_default_prefix | ||
fi | ||
GLUSTERFS_LIBEXECDIR="$(eval echo $prefix)/libexec/glusterfs" | ||
-GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd" | ||
+GLUSTERFSD_MISCDIR="$(eval echo $localstatedir)/var/lib/misc/glusterfsd" | ||
prefix=$old_prefix | ||
|
||
### Dirty hacky stuff to make LOCALSTATEDIR work | ||
-- | ||
2.12.0 | ||
|
49 changes: 49 additions & 0 deletions
49
pkgs/tools/filesystems/glusterfs/glusterfs-glusterfind-log-remote-node_cmd-error.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From 92a6b84a37e7e2e0ec0655ca45cedb64ab72080e Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me> | ||
Date: Fri, 8 Sep 2017 02:40:01 +0200 | ||
Subject: [PATCH] glusterfind: Log remote stderr on `node_cmd` error. | ||
|
||
The problem of lost stderr was introduced in | ||
commit feea851fad4f89b48bfe89fe3b75250cc7bd6501. | ||
|
||
Change-Id: Ic98f9bc9682ae3bd9c3ebea3855667fc8ba2843d | ||
--- | ||
tools/glusterfind/src/main.py | 17 ++++++++++++++++- | ||
1 file changed, 16 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py | ||
index c125f970a..6fffce4b3 100644 | ||
--- a/tools/glusterfind/src/main.py | ||
+++ b/tools/glusterfind/src/main.py | ||
@@ -75,12 +75,27 @@ def node_cmd(host, host_uuid, task, cmd, args, opts): | ||
cmd = ["ssh", | ||
"-oNumberOfPasswordPrompts=0", | ||
"-oStrictHostKeyChecking=no", | ||
+ # We force TTY allocation (-t -t) so that Ctrl+C is handed | ||
+ # through; see: | ||
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1382236 | ||
+ # Note that this turns stderr of the remote `cmd` | ||
+ # into stdout locally. | ||
"-t", | ||
"-t", | ||
"-i", pem_key_path, | ||
"root@%s" % host] + cmd | ||
|
||
- execute(cmd, exit_msg="%s - %s failed" % (host, task), logger=logger) | ||
+ (returncode, err, out) = execute(cmd, logger=logger) | ||
+ if returncode != 0: | ||
+ # Because the `-t -t` above turns the remote stderr into | ||
+ # local stdout, we need to log both stderr and stdout | ||
+ # here to print all error messages. | ||
+ fail("%s - %s failed; stdout (including remote stderr):\n" | ||
+ "%s\n" | ||
+ "stderr:\n" | ||
+ "%s" % (host, task, out, err), | ||
+ returncode, | ||
+ logger=logger) | ||
|
||
if opts.get("copy_outfile", False) and not localdir: | ||
cmd_copy = ["scp", | ||
-- | ||
2.12.0 | ||
|