Commit 067e7bf6 authored by Mike Hibler's avatar Mike Hibler

1. synch with BSD version as much as possible

2. after killing dhclient, "ifconfig down" the non-control net IFs
   that get left up by dhclient
parent a9b0382c
......@@ -6,32 +6,31 @@
#
. /etc/emulab/paths.sh
if [ x$reason != xREBOOT -a x$reason != xBOUND -a x$reason != xRENEW -a x$reason != xREBIND ]
then
exit 0
fi
#
# A note about Linux. Redhat 9.0 appears to use dhclient instead of pump.
# We maintain/install both variants though to make life easier.
# Remember our server IP, real hostname, router IP, etc.
#
echo $new_dhcp_server_identifier > $BOOTDIR/bossip
echo $new_host_name > $BOOTDIR/realname
echo $new_routers > $BOOTDIR/routerip
echo $new_ip_address > $BOOTDIR/myip
echo $new_subnet_mask > $BOOTDIR/mynetmask
if [ -n "$interface" ]; then
echo $interface > $BOOTDIR/controlif
fi
date > $LOGDIR/dhclient.log
echo "$reason" >> $LOGDIR/dhclient.log
#
# See if the Testbed configuration software wants to change the hostname.
#
$BINDIR/sethostname.dhclient >$LOGDIR/dhclient.log 2>&1
#
# Remember our server IP, real hostname, router IP, etc.
# The killing of dhclient and shutdown of other interfaces is handled
# by the dhclient caller (sysconfig/network-scripts/ifcfg-eth99)
#
if [ x$reason = xREBOOT ] || [ x$reason = xBOUND ] || \
[ x$reason = xRENEW ] || [ x$reason = xREBIND ]; then
echo $new_dhcp_server_identifier > $BOOTDIR/bossip
echo $new_host_name > $BOOTDIR/realname
echo $new_routers > $BOOTDIR/routerip
echo $new_ip_address > $BOOTDIR/myip
echo $new_subnet_mask > $BOOTDIR/mynetmask
if [ -n "$interface" ]; then
echo $interface > $BOOTDIR/controlif
fi
#
# See if the Testbed configuration software wants to change the hostname.
#
$BINDIR/sethostname.dhclient >>$LOGDIR/dhclient.log 2>&1
fi
exit 0
......@@ -8,6 +8,9 @@
# interface, we would wind up recursively invoking dhclient (trust me,
# I tried it :-)
#
. /etc/emulab/paths.sh
DEVICE="eth99"
IFACETYPES="3c59x eepro100 e1000 tulip"
......@@ -19,13 +22,26 @@ modprobe -qa $IFACETYPES
#
# If dhclient returns success, then it has configured the first interface
# and gone into background mode. At that point we don't care about it any
# more and just kill it. We also set ONBOOT=no to prevent ifup (our caller)
# more and just kill it. We also shutdown all the other interfaces (which
# dhclient will leave "up") and set ONBOOT=no to prevent ifup (our caller)
# from doing any further configuration on this fake interface.
#
if [ -x /sbin/dhclient ] && /sbin/dhclient -q ; then
killall dhclient
ONBOOT="no"
killall dhclient
if [ -e $BOOTDIR/controlif ]; then
interface=`cat $BOOTDIR/controlif`
for _if in `ifconfig -s | awk '{ print $1 }' | grep -v Iface`
do
if [ $_if != "lo" -a x$_if != x$interface ]
then
echo "taking $_if down"
ifconfig $_if down
fi >>$LOGDIR/dhclient.log 2>&1
done
fi
ONBOOT="no"
else
# eat flaming death
exit 1
# eat flaming death
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment