From 766ec96e3d6e1b8d7a73bbc46817b763d77d9b2a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 9 May 2008 10:29:06 +0000 Subject: [PATCH] Add ifdown_eth0=NO so that the interface stays up for WakeOnLan, Gentoo #220875 --- doc/net.example.BSD.in | 4 ++++ doc/net.example.Linux.in | 4 ++++ init.d/net.lo.in | 11 ++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/net.example.BSD.in b/doc/net.example.BSD.in index 31d61055..e78f6161 100644 --- a/doc/net.example.BSD.in +++ b/doc/net.example.BSD.in @@ -87,6 +87,10 @@ # is how long we wait for carrier. The current default is 3 seconds #carrier_timeout_eth0=-1 +# You may wish to disable the interface being brought down when stopping. +# This is only of use for WakeOnLan. +#ifdown_eth0="NO" + ############################################################################## # OPTIONAL MODULES diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in index 80d50479..136072f0 100644 --- a/doc/net.example.Linux.in +++ b/doc/net.example.Linux.in @@ -120,6 +120,10 @@ # tables you may have to set a global metric as the due to a simple read of # the routing table taking over a minute at a time. +# You may wish to disable the interface being brought down when stopping. +# This is only of use for WakeOnLan. +#ifdown_eth0="NO" + ############################################################################## # OPTIONAL MODULES diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 8f53a86c..cce62e5a 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -663,9 +663,14 @@ stop() fi done - ! yesno ${IN_BACKGROUND} && \ - [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ] && \ - _down 2>/dev/null + # If not in background, and not loopback then bring the interface down + # unless overridden. + if ! yesno ${IN_BACKGROUND} && \ + [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then + eval module=\$ifdown_${IFVAR} + module=${module:-YES} + yesno ${module} && _down 2>/dev/null + fi type resolvconf >/dev/null 2>&1 && resolvconf -d "${IFACE}" 2>/dev/null