Summary: Using the LSB Bootscripts

Jeremy Huntwork jhuntwork at
Wed May 18 12:35:48 PDT 2011

On 5/18/11 12:28 AM, Bryan Kadzban wrote:
> Anybody know how other distros do it?  I can't figure out what Debian's
> ifdown binary is supposed to do (its source is *extremely* obfuscated,
> being built from a texinfo file, and containing a file parser)...

Fedora does a much more elaborate version of what I included in my 
adjusted scripts. First it checks to see what type of a network device 
it is and then process a specific down script for that device type.

In the Ethernet type, which is default, they check to see if dhcp is 
running and if the device has a lease and if so release it. Then they have:

# we can't just delete the configured address because that address
# may have been changed in the config file since the device was
# brought up.  Flush all addresses associated with this
# instance instead.
if [ -d "/sys/class/net/${REALDEVICE}" ]; then
         if [ "${REALDEVICE}" = "${DEVICE}" ]; then
                 ip addr flush dev ${REALDEVICE} 2>/dev/null
                 ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null

         if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then
                 echo "-${DEVICE}" > 
/sys/class/net/${MASTER}/bonding/slaves 2>/dev/null

         if [ "${REALDEVICE}" = "${DEVICE}" ]; then
                 ip link set dev ${DEVICE} down 2>/dev/null

After that they also check for any specific bridging rules and handle 
that as well.


More information about the lfs-dev mailing list