fff-layer3-config: Disable SIGHUP during test mode

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 <fabian@blaese.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>
This commit is contained in:
Fabian Bläse 2021-08-05 19:42:04 +02:00
parent ec94095599
commit ffd00a93a7
2 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-layer3-config
PKG_RELEASE:=7
PKG_RELEASE:=8
include $(INCLUDE_DIR)/package.mk

View File

@ -73,6 +73,7 @@ keep_changes() {
test_changes() {
echo $$ > /tmp/configure-layer3-pid
trap keep_changes SIGINT SIGTERM
trap : SIGHUP
reload_services