diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog index 9c8cca44f..8d37e862f 100644 --- a/bootscripts/ChangeLog +++ b/bootscripts/ChangeLog @@ -1,3 +1,7 @@ +2021-06-08 Bruce Dubbs + * When shutting down the network, ignore invalid interfaces + or interfaces that are not UP. + 2021-06-02 Thomas Trepl * Prevent sendsignals from killing an active mdmon @@ -5,7 +9,7 @@ * Make check_signal more robust. * Use a better methog for killproc to remove a dead pid file. * Clarify what signals killproc accepts. - * Thanks to input an ddiscussion from Scott Andrews. + * Thanks to input and discussion from Scott Andrews. 2021-02-01 Bruce Dubbs * Tweak mountfs to properly exit when an error is found. diff --git a/bootscripts/lfs/init.d/network b/bootscripts/lfs/init.d/network index 17afa0983..710cfcfd4 100644 --- a/bootscripts/lfs/init.d/network +++ b/bootscripts/lfs/init.d/network @@ -35,10 +35,7 @@ case "${1}" in interface=${file##*/ifconfig.} # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ] - then - continue - fi + if [ "${interface}" = "*" ]; then continue; fi /sbin/ifup ${interface} done @@ -61,10 +58,14 @@ case "${1}" in interface=${file##*/ifconfig.} # Skip if $file is * (because nothing was found) - if [ "${interface}" = "*" ] - then - continue - fi + if [ "${interface}" = "*" ]; then continue; fi + + # See if interface exists + if [ ! -e /sys/class/net/$interface ]; then continue; fi + + # Is interface UP? + ip link show $interface 2>/dev/null | grep -q "state UP" + if [ $? -ne 0 ]; then continue; fi /sbin/ifdown ${interface} done diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index 7e4710966..4815576ea 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -44,6 +44,15 @@ or as appropriate for the entry or if needed the entire day's listitem. --> + + 2021-06-08 + + + [bdubbs] - Make shutting down the netwrok more robust. + + + + 2021-06-02 diff --git a/packages.ent b/packages.ent index 33ce9dda4..59d4c90a8 100644 --- a/packages.ent +++ b/packages.ent @@ -384,7 +384,7 @@ - +