summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-01-14 17:50:38 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-01-14 17:50:38 +0400
commitca6b86f42043d1eb80e8afd110c66ca79e948ef0 (patch)
tree43a2a896c4727debf77057265c3b473d61d80d61 /mysql-test/lib
parentd9d994089fc574d1973b476673ccbc8a6481f8c6 (diff)
downloadmariadb-git-ca6b86f42043d1eb80e8afd110c66ca79e948ef0.tar.gz
MDEV-7448 - mtr may leave stale mysqld
Let mtr handle SIGHUP the same way as SIGINT. This solves stale mysqld processes left after broken/closed ssh connection.
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/My/SafeProcess/Base.pm1
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc3
2 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm
index 0e8c191c440..1ac0120a735 100644
--- a/mysql-test/lib/My/SafeProcess/Base.pm
+++ b/mysql-test/lib/My/SafeProcess/Base.pm
@@ -180,6 +180,7 @@ sub create_process {
}
$SIG{INT}= 'DEFAULT';
+ $SIG{HUP}= 'DEFAULT';
# Make this process it's own process group to be able to kill
# it and any childs(that hasn't changed group themself)
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index f19ca622278..d6110f5f8c8 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -141,6 +141,7 @@ extern "C" void handle_signal(int sig)
// Ignore further signals
signal(SIGTERM, SIG_IGN);
signal(SIGINT, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
// Continune execution, allow the child to be started and
// finally terminated by monitor loop
@@ -164,6 +165,7 @@ int main(int argc, char* const argv[] )
/* Install signal handlers */
sigaction(SIGTERM, &sa,NULL);
sigaction(SIGINT, &sa,NULL);
+ sigaction(SIGHUP, &sa, NULL);
sigaction(SIGCHLD, &sa,NULL);
sigaction(SIGABRT, &sa_abort,NULL);
@@ -231,6 +233,7 @@ int main(int argc, char* const argv[] )
// Use default signal handlers in child
signal(SIGTERM, SIG_DFL);
signal(SIGINT, SIG_DFL);
+ signal(SIGHUP, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
// Make this process it's own process group to be able to kill