aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Cavalca <davide125@tiscali.it>2017-12-04 03:16:22 -0800
committerDee'Kej <deekej@linuxmail.org>2017-12-04 12:16:22 +0100
commit2eaa9d1e7b682ce895d56966d9178dcfa0c822b1 (patch)
tree45c2f863f4e298c289a4d901aef1ed0e2ce3ede3
parent2343075df4b18b5fbd35d2fe5f99f16e59478b3c (diff)
downloadinitscripts-2eaa9d1e7b682ce895d56966d9178dcfa0c822b1.tar
initscripts-2eaa9d1e7b682ce895d56966d9178dcfa0c822b1.tar.gz
initscripts-2eaa9d1e7b682ce895d56966d9178dcfa0c822b1.tar.bz2
initscripts-2eaa9d1e7b682ce895d56966d9178dcfa0c822b1.tar.xz
initscripts-2eaa9d1e7b682ce895d56966d9178dcfa0c822b1.zip
network: add knob to optionally keep interfaces up during shutdown (#154)
* network: add knob to optionally keep interfaces up during shutdown
-rwxr-xr-xrc.d/init.d/network9
-rw-r--r--sysconfig.txt5
2 files changed, 14 insertions, 0 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 92da47db..7e4b2b1b 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -167,6 +167,15 @@ stop)
exit 1
fi
+ # Don't shut the network down when shutting down the system if configured
+ # as such in sysconfig
+ if is_false "$IFDOWN_ON_SHUTDOWN"; then
+ if systemctl is-system-running | grep -q 'stopping'; then
+ net_log $"system is shutting down, leaving interfaces up as requested"
+ exit 1
+ fi
+ fi
+
vlaninterfaces=""
vpninterfaces=""
xdslinterfaces=""
diff --git a/sysconfig.txt b/sysconfig.txt
index d5d600e5..8f347cb7 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -178,6 +178,11 @@ Generic options:
network has spanning tree running and must wait for STP convergence.
Default: 0 (no delay)
+ IFDOWN_ON_SHUTDOWN=yes|no
+ If yes, do bring interfaces down during system shutdown. If no, leave them
+ in their current state (this is only supported on hosts using systemd).
+ Default: yes (bring interfaces down)
+
IPV6FORWARDING=yes|no
Enable or disable global forwarding of incoming IPv6 packets