Commit bbb4ebe0 authored by David Johnson's avatar David Johnson

Fix findcnet for newer udev reliable fixed device names.

In the latest udev world, udev generates predictable device names using
firmware info and/or pci buss info (i.e., eno1 or enps4f0).  So, we now
try to run dhclient only on real ethernet devices (i.e., eth*, en*,
sl*).  There are other kinds of ethernet devices (i.e. wireless, wl*,
ww*) or virtual devices, but we don't care about finding the control net
on those.  Might need to add another device name prefix for PV devices
in Xen guests... we'll see.
parent c2bd98f6
......@@ -138,7 +138,14 @@ elif static_widearea_config $iface; then
if [ "$cnetif" = "$iface" ]; then
echo $iface > $cnetfile
cnetif=`cat $cnetfile`
/sbin/initctl emit -n 'emulab-findcnet-done'
# Emit this upstart event to allow boot to continue, even
# if we couldn't get a dhcp lease.
# Otherwise, if this is systemd, we have a special job that
# is waiting for the /var/run/cnet file to appear.
if [ -f /sbin/initctl ]; then
/sbin/initctl emit -n 'emulab-findcnet-done'
fi
else
#
# If not, don't fail; there was widearea config info; but also don't
......@@ -151,7 +158,7 @@ else
#
# Find a list of candidate interfaces
#
_iflist=`ifconfig -a | grep '^eth' | awk '{ print $1 }'`
_iflist=`ifconfig -a | grep -E '^(eth|en|sl)' | awk '{ print $1 }'`
echo "`date`: $iface: findcnet running dhclient on: $_iflist"
#
......@@ -175,7 +182,11 @@ else
# Emit this upstart event to allow boot to continue, even
# if we couldn't get a dhcp lease.
/sbin/initctl emit -n 'emulab-findcnet-done'
# Otherwise, if this is systemd, we have a special job that
# is waiting for the /var/run/cnet file to appear.
if [ -f /sbin/initctl ]; then
/sbin/initctl emit -n 'emulab-findcnet-done'
fi
fi >>$LOGDIR/dhclient.log 2>&1
#
......
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