From 365efb9d3a6ba7eaf1e60a3472af09f854e8f7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 22 May 2019 09:38:04 +0300 Subject: [PATCH] Ignore SIGHUP termination in ssh_node Sometimes the command appears to complete and terminate with a SIGHUP instead of the proper return value. --- maxscale-system-test/nodes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maxscale-system-test/nodes.cpp b/maxscale-system-test/nodes.cpp index 25b1ab1b6..68fda7ce6 100644 --- a/maxscale-system-test/nodes.cpp +++ b/maxscale-system-test/nodes.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "envv.h" @@ -189,8 +190,14 @@ int Nodes::ssh_node(int node, const char* ssh, bool sudo) { return WEXITSTATUS(rc); } + else if (WIFSIGNALED(rc) && WTERMSIG(rc) == SIGHUP) + { + // SIGHUP appears to happen for SSH connections + return 0; + } else { + std::cout << strerror(errno) << std::endl; return 256; } }