From ffd00a93a76f37ba1f1e7a6051db770a53e1c978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Thu, 5 Aug 2021 19:42:04 +0200 Subject: [PATCH] fff-layer3-config: Disable SIGHUP during test mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SIGHUP signal is sent to a process if a hangup is detected on the controlling terminal. This might happen if the ssh session, from which the test mode was started, is disconnected. Because ssh session disconnects might happen due to network reconfiguration, aborting the test mode without restoring the old settings might make the device unreachable. Instead, disable the SIGHUP signal when test mode is activated, so the script is either killed by the user (after successful configuration) or the timer expires and the old settings are restored. Fixes: #141 Signed-off-by: Fabian Bläse Reviewed-by: Christian Dresel Reviewed-by: Johannes Kimmel --- src/packages/fff/fff-layer3-config/Makefile | 2 +- .../fff/fff-layer3-config/files/usr/sbin/configure-layer3 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/fff/fff-layer3-config/Makefile b/src/packages/fff/fff-layer3-config/Makefile index 867d788b..b4b776ff 100644 --- a/src/packages/fff/fff-layer3-config/Makefile +++ b/src/packages/fff/fff-layer3-config/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-layer3-config -PKG_RELEASE:=7 +PKG_RELEASE:=8 include $(INCLUDE_DIR)/package.mk diff --git a/src/packages/fff/fff-layer3-config/files/usr/sbin/configure-layer3 b/src/packages/fff/fff-layer3-config/files/usr/sbin/configure-layer3 index 8755ad44..b32a7100 100755 --- a/src/packages/fff/fff-layer3-config/files/usr/sbin/configure-layer3 +++ b/src/packages/fff/fff-layer3-config/files/usr/sbin/configure-layer3 @@ -73,6 +73,7 @@ keep_changes() { test_changes() { echo $$ > /tmp/configure-layer3-pid trap keep_changes SIGINT SIGTERM + trap : SIGHUP reload_services