Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
55487c53
Commit
55487c53
authored
Aug 07, 2014
by
Mike Hibler
Browse files
Add client-side Ubuntu14 directory.
Same as ubuntu11 right now.
parent
9abc199d
Changes
22
Hide whitespace changes
Inline
Side-by-side
clientside/configure
View file @
55487c53
...
...
@@ -4945,6 +4945,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/linux-sg/GNUmakefile tmcc/ubuntu7/GNUmakefile
\
tmcc/ubuntu10/GNUmakefile
\
tmcc/ubuntu11/GNUmakefile
\
tmcc/ubuntu14/GNUmakefile
\
tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile
\
tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile
\
tmcc/freebsd6/netif-emulab
\
...
...
clientside/configure.in
View file @
55487c53
...
...
@@ -270,6 +270,7 @@ outfiles="Makeconf GNUmakefile setversion \
tmcc/linux-sg/GNUmakefile tmcc/ubuntu7/GNUmakefile \
tmcc/ubuntu10/GNUmakefile \
tmcc/ubuntu11/GNUmakefile \
tmcc/ubuntu14/GNUmakefile \
tmcc/freebsd5/GNUmakefile tmcc/freebsd5/supfile \
tmcc/freebsd6/GNUmakefile tmcc/freebsd6/supfile \
tmcc/freebsd6/netif-emulab \
...
...
clientside/tmcc/GNUmakefile.in
View file @
55487c53
...
...
@@ -97,7 +97,7 @@ ifeq ($(MDSUBDIR),redhat9)
MDSUBDIR = linux9
endif
ifeq ($(MDSUBDIR),ubuntu14)
MDSUBDIR = ubuntu1
1
MDSUBDIR = ubuntu1
4
endif
ifeq ($(MDSUBDIR),ubuntu12)
MDSUBDIR = ubuntu11
...
...
clientside/tmcc/ubuntu14/GNUmakefile.in
0 → 100644
View file @
55487c53
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
#
# XXX ONLY RUN THIS INSTALL ON AN UBUNTO LINUX TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: supfile ifcfgs
include $(TESTBED_SRCDIR)/GNUmakerules
SYSETCDIR = $(DESTDIR)/etc
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(SYSETCDIR)
RRCDIR = /etc
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
DEFRUNLVLDIR ?= $(SYSETCDIR)/rc3.d
install client-install: common-install etc-install \
script-install bin-install sysetc-fixup
@echo "Remember to install the PEM files if necessary"
simple-install: common-install script-install bin-install
dir-install:
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/init
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/network
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/rsyslog.d
common-install: dir-install
(cd ../common; $(MAKE) DESTDIR=$(DESTDIR) local-install)
bin-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) bin-install)
$(INSTALL) -m 755 $(SRCDIR)/findcnet $(BINDIR)/findcnet
etc-install: dir-install common-sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
$(INSTALL) -m 644 $(SRCDIR)/passwd $(ETCDIR)/passwd
$(INSTALL) -m 600 $(SRCDIR)/shadow $(ETCDIR)/shadow
$(INSTALL) -m 600 $(SRCDIR)/gshadow $(ETCDIR)/gshadow
$(INSTALL) -m 644 $(SRCDIR)/hosts $(ETCDIR)/hosts
common-sysetc-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) RRCDIR=$(RRCDIR) sysetc-install)
sysetc-fixup:
rm -rf $(SYSETCDIR)/modules.conf $(SYSETCDIR)/cron.pend $(SYSETCDIR)/sysconfig $(SYSETCDIR)/init.d/ntpd
rm -f $(SYSETCDIR)/dhclient-enter-hooks \
$(SYSETCDIR)/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
$(SYSETCDIR)/dhcp/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks \
$(SYSETCDIR)/dhcp/dhclient-enter-hooks
rm -f $(SYSETCDIR)/rc.local
$(INSTALL) -m 644 $(SRCDIR)/rc-sysinit.conf $(SYSETCDIR)/init/rc-sysinit.conf
$(INSTALL) -m 644 $(SRCDIR)/rsyslog-emulab.conf $(SYSETCDIR)/rsyslog.d/60-emulab.conf
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(SYSETCDIR)/rc.local
$(INSTALL) -m 644 $(SRCDIR)/interfaces $(SYSETCDIR)/network/interfaces
script-install: dir-install $(SCRIPTS)
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) script-install)
genirack-install:
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) genirack-install)
$(INSTALL) -m 755 $(SRCDIR)/genirack.sh $(RCDIR)/init.d/genirack.sh
-ln -sf $(RRCDIR)/init.d/genirack.sh $(DEFRUNLVLDIR)/S10genirack.sh
-ln -sf $(RRCDIR)/init.d/genirack.sh $(SYSETCDIR)/rc2.d/S10genirack.sh
-ln -sf $(RRCDIR)/init.d/genirack.sh $(SYSETCDIR)/rc4.d/S10genirack.sh
-ln -sf $(RRCDIR)/init.d/genirack.sh $(SYSETCDIR)/rc5.d/S10genirack.sh
$(INSTALL) -m 644 $(SRCDIR)/interfaces-genirack $(SYSETCDIR)/network/interfaces
$(INSTALL) -m 644 $(SRCDIR)/isc-dhcp-server $(SYSETCDIR)/default/
$(INSTALL) -m 644 $(SRCDIR)/dhcpd.conf $(SYSETCDIR)/dhcp/
sfs-install:
clientside/tmcc/ubuntu14/dhclient-enter-hooks
0 → 100755
View file @
55487c53
#!/bin/sh
#
# Copyright (c) 2004-2009 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
.
/etc/emulab/paths.sh
#
# Sweet! dhclient on linux wants to DHCP on the loopback interface
# thus screwing up its default setting. Put a stop to that early on!
#
if
[
xxx
$interface
=
xxxlo
]
;
then
exit_status
=
1
return
fi
echo
"
`
date
`
:
${
interface
}
:
${
reason
}
"
>>
$LOGDIR
/dhclient-enter.log 2>&1
#
# XXX Hack to force the duplex on interfaces
#
setduplex
()
{
_if
=
$1
_rc
=
0
if
[
-x
/sbin/ethtool
]
;
then
_ethtool
=
/sbin/ethtool
else
_ethtool
=
/usr/sbin/ethtool
fi
_out
=
`
$_ethtool
$_if
`
if
[
$?
-eq
0
]
;
then
_hmb
=
`
echo
$_out
|
grep
-c
'Speed: 100Mb/s'
`
_fdx
=
`
echo
$_out
|
grep
-c
'Duplex: Full'
`
else
_out
=
`
/sbin/mii-tool
$_if
`
_hmb
=
`
echo
$_out
|
grep
-c
'100 Mbit'
`
_fdx
=
`
echo
$_out
|
grep
-c
'full duplex'
`
fi
if
[
$_hmb
-ne
0
-a
$_fdx
-ne
0
]
;
then
echo
"
$_if
: speed/duplex correct"
else
echo
-n
"
$_if
: fixing speed/duplex..."
if
$_ethtool
$_if
>
/dev/null 2>&1
;
then
$_ethtool
-s
$_if
autoneg off speed 100 duplex full
else
/sbin/mii-tool
--force
=
100baseTx-FD
$_if
fi
_rc
=
$?
echo
"returns
$_rc
"
fi
return
$_rc
}
if
[
x
$reason
!=
xREBOOT
-a
x
$reason
!=
xBOUND
-a
x
$reason
!=
xRENEW
-a
x
$reason
!=
xREBIND
]
then
# do nothing
true
elif
[
x
"
$new_domain_name_servers
"
=
"x1.1.1.1"
]
;
then
#
# ElabinElab support.
#
# XXX oh so hacky. Real boss is set to return 1.1.1.1 as a name server
# for nodes in inner elabs. This is the hack de jour for determining
# who has responded to our DHCP request. If it is outer boss and we are
# an inner node, we want to decline this offer and not configure the
# interface
#
exit_status
=
1
#
# XXX it just keeps getting better! The Ubuntu (Debian?) dhclient-script
# doesn't check that status code and just plows ahead. Thus we will wind
# up with a resolv.conf file with 1.1.1.1 as the name server. So if we
# currently have a legit resolv.conf (one without a 1.1.1.1 nameserver),
# save that off so we can restore it in the exit hook.
#
if
grep
-q
1.1.1.1 /etc/resolv.conf
;
then
echo
"
`
date
`
:
${
interface
}
: resolv.conf already bad"
else
echo
"
`
date
`
:
${
interface
}
: saving current resolv.conf"
cp
-p
/etc/resolv.conf /etc/resolv.conf.good
fi
>>
$LOGDIR
/dhclient-enter.log 2>&1
#
# XXX since we now know that we are in an inner elab and we know which
# interface is the real control net, we force 100Mb full-duplex on all
# other (experimental) interfaces. This is necessary to ensure a
# response from the inner control net.
#
for
_if
in
`
ifconfig
-s
|
awk
'{ print $1 }'
|
grep
-v
Iface
`
do
if
[
$_if
!=
"lo"
-a
x
$_if
!=
x
$interface
]
;
then
setduplex
$_if
>>
$LOGDIR
/dhclient-enter.log 2>&1
fi
done
#
# XXX sleep here so we don't pummel boss with REQUEST/DECLINE pairs.
#
sleep
3
elif
[
"
$new_network_number
"
=
"10.200.1.0"
]
;
then
#
# XXX sometime we can get a reply even if the duplex is wrong.
# If we get such a reply and we are inside an inner elab, again
# force 100Mb full-duplex to make sure we continue to communicate
# with the server.
#
setduplex
$interface
>>
$LOGDIR
/dhclient-enter.log 2>&1
fi
echo
"
`
date
`
:
${
interface
}
:
${
reason
}
: done"
>>
$LOGDIR
/dhclient-enter.log 2>&1
clientside/tmcc/ubuntu14/dhclient-exit-hooks
0 → 100644
View file @
55487c53
#!/bin/sh
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
.
/etc/emulab/paths.sh
echo
"
`
date
`
:
${
interface
}
:
${
reason
}
"
>>
$LOGDIR
/dhclient-exit.log 2>&1
if
[
x
$reason
!=
xREBOOT
-a
x
$reason
!=
xBOUND
-a
x
$reason
!=
xRENEW
-a
x
$reason
!=
xREBIND
]
then
exit
0
fi
#
# ElabinElab support
#
# The enter-hooks script should weed out outer boss calls, so there
# should be nothing to do here. However, just in case we smack em down
# again here.
#
# XXX we will get here on Ubuntu (Debian?), as the exit status of the
# enter hook is not checked (see dhclient-enter-hook). At this point
# we have a bogus resolv.conf file and we must fix it up.
#
if
[
x
"
$new_domain_name_servers
"
=
"x1.1.1.1"
]
;
then
echo
-n
"
`
date
`
:
${
interface
}
: exit with bad name server..."
if
[
-f
/etc/resolv.conf.good
]
;
then
echo
"replacing"
mv
/etc/resolv.conf.good /etc/resolv.conf
else
echo
"no good replacement, removing"
cp
/dev/null /etc/resolv.conf
fi
exit_status
=
1
exit
1
fi
>>
$LOGDIR
/dhclient-exit.log 2>&1
#
# 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
echo
$new_domain_name
>
$BOOTDIR
/mydomain
if
[
-n
"
$interface
"
]
;
then
echo
$interface
>
$BOOTDIR
/controlif
fi
#
# For Xen-based vnodes we record the vnode name where the scripts expect it.
# XXX this works because only Xen-based vnodes DHCP.
#
case
"
$new_host_name
"
in
pcvm
*
)
echo
$new_host_name
>
$BOOTDIR
/vmname
;;
esac
#
# If this is a newnode boot, boss (inner or outer) will have returned with
# no hostname. We don't need to record anything in this case, so skip it.
#
if
[
x
"
$new_host_name
"
=
x
]
;
then
exit
0
fi
#
# We have observed problems where changing the speed/duplex of a link
# leaves DNS a little wonky. So we whack on it til it responds so that
# the sethostname script won't fail.
#
if
[
"
$new_network_number
"
=
"10.200.1.0"
]
;
then
for
i
in
0 1 2
;
do
if
`
$BINDIR
/tmcc bossinfo
>
/dev/null 2>&1
`
;
then
break
fi
echo
"
`
date
`
:
${
interface
}
: waiting for DNS.."
>>
$LOGDIR
/dhclient-exit.log 2>&1
sleep
$i
done
fi
#
# See if the Testbed configuration software wants to change the hostname.
#
$BINDIR
/sethostname.dhclient
>>
$LOGDIR
/dhclient.log 2>&1
echo
"
`
date
`
:
${
interface
}
:
${
reason
}
: done"
>>
$LOGDIR
/dhclient-exit.log 2>&1
#
# The killing of dhclient and shutdown of other interfaces is handled
# by the dhclient caller (sysconfig/network-scripts/ifcfg-eth99)
#
exit
0
clientside/tmcc/ubuntu14/dhcpd.conf
0 → 100644
View file @
55487c53
#
# dhcpd.conf. For the Genrack control node. Do not install anyplace else!
#
server
-
identifier
10
.
1
.
1
.
254
;
server
-
name
"10.1.1.254"
;
default
-
lease
-
time
36000
;
# 10 hours
max
-
lease
-
time
36000
;
# 10 hours
ddns
-
update
-
style
none
;
# req'd vers 3 directive
subnet
10
.
1
.
1
.
0
netmask
255
.
255
.
255
.
0
{
option
subnet
-
mask
255
.
255
.
255
.
0
;
option
routers
10
.
1
.
1
.
254
;
range
10
.
1
.
1
.
253
;
}
subnet
10
.
2
.
1
.
0
netmask
255
.
255
.
255
.
0
{
option
subnet
-
mask
255
.
255
.
255
.
0
;
option
routers
10
.
2
.
1
.
254
;
range
10
.
2
.
1
.
253
;
}
clientside/tmcc/ubuntu14/findcnet
0 → 100644
View file @
55487c53
#!/bin/sh
#
# Find the Emulab control network interface.
#
# When called the first time (an invocation on any interface when
# /var/emulab/boot/controlif does not exist) we run DHCP and find the
# control network.
#
# On all invocations, we check the contents of that file against the
# interface we were called with and return "cnet" if we are the control
# net. Otherwise we just return the physical interface name.
#
static_widearea_config
()
{
local
iface
=
$1
if
[
-e
/etc/emulab/isrem
-a
-e
/etc/emulab/waconfig
]
;
then
echo
"Found Emulab widearea config info..."
.
/etc/emulab/waconfig
else
return
1
fi
# XXX check WA_MAC?
if
[
"
$WA_BOOTMETHOD
"
!=
static
]
;
then
return
1
fi
cnetif
=
`
/sbin/ifconfig
-a
|
\
sed
-n
's/^\([^ ]*\) *Link encap:Ethernet *HWaddr '
$WA_MAC
' *$/\1/ip'
`
if
[
-z
"
$cnetif
"
]
;
then
echo
"Could not find iface with MAC
$WA_MAC
; trying DHCP!"
return
1
elif
[
-z
"
$WA_HOSTNAME
"
-o
-z
"
$WA_DOMAIN
"
-o
\
-z
"
$WA_IP_ADDR
"
-o
-z
"
$WA_IP_NETMASK
"
-o
\
-z
"
$WA_IP_GATEWAY
"
-o
-z
"
$WA_IP_DNS1
"
]
;
then
echo
"Missing static IP config vars; trying DHCP!"
return
1
fi
# Make sure ifup passed us the correct interface. If not,
# exit successfully so that the DHCP client isn't run
if
[
"
$cnetif
"
!=
"
$iface
"
]
;
then
return
0
fi
# We're going ahead with the static config
echo
"Statically configuring control net on
$cnetif
..."
/sbin/ifconfig
"
$cnetif
"
inet
"
$WA_IP_ADDR
"
netmask
"
$WA_IP_NETMASK
"
up
/sbin/route add default gateway
"
$WA_IP_GATEWAY
"
# setup resolv.conf
echo
"search
$WA_DOMAIN
"
>
/etc/resolv.conf
echo
"nameserver
$WA_IP_DNS1
"
>>
/etc/resolv.conf
if
[
-n
"
$WA_IP_DNS2
"
]
;
then
echo
"nameserver
$WA_IP_DNS2
"
>>
/etc/resolv.conf
fi
# set hostname
hosts_str
=
"
$WA_HOSTNAME
"
if
echo
"
$WA_HOSTNAME
"
|
grep
-q
\\
.
;
then
hostname
"
$WA_HOSTNAME
"
else
hostname
"
${
WA_HOSTNAME
}
.
${
WA_DOMAIN
}
"
hosts_str
=
"
${
WA_HOSTNAME
}
.
${
WA_DOMAIN
}
${
hosts_str
}
"
fi
# setup hosts file
echo
"
$WA_IP_ADDR
${
hosts_str
}
"
>>
/etc/hosts
# setup a few necessary emulab files...
echo
"
$cnetif
"
>
$BOOTDIR
/controlif
if
[
-e
"/etc/emulab/bossnode"
]
;
then
bossnode
=
`
cat
/etc/emulab/bossnode
`
i
=
0
while
[
$i
-lt
6
]
;
do
bossip
=
`
host
-t
A
"
$bossnode
"
`
[
$?
-eq
0
]
&&
break
i
=
`
expr
$i
+ 1
`
sleep
5
done
echo
`
echo
"
$bossip
"
|
sed
-n
-e
's/.*has address\s*\(.*\)/\1/p'
`
\
>
$BOOTDIR
/bossip
fi
echo
"
$WA_HOSTNAME
"
>
$BOOTDIR
/realname
echo
"
$WA_IP_GATEWAY
"
>
$BOOTDIR
/routerip
echo
"
$WA_IP_ADDR
"
>
$BOOTDIR
/myip
echo
"
$WA_IP_NETMASK
"
>
$BOOTDIR
/mynetmask
return
0
}
export
LANG
=
C
iface
=
"
$1
"
cnetfile
=
"/var/run/cnet"
cnetif
=
''
# We only need the lock if the file doesn't exist.
# XXX keep this lightweight as it can be called many times from
# ifquery in the udev path.
if
[
-f
$cnetfile
]
;
then
cnetif
=
`
cat
$cnetfile
`
if
[
"
$cnetif
"
=
$iface
]
;
then
echo
cnet
else
echo
$iface
fi
exit
0
fi
lockdir
=
/var/lock/findcnet
.
/etc/emulab/paths.sh
while
!
mkdir
$lockdir
2> /dev/null
;
do
sleep
1
done
echo
"
`
date
`
:
$iface
: starting"
>>
$LOGDIR
/dhclient.log
#
# We use /var/run to store the current idea of the cnet interface
# because we want it to go away on reboot.
#
if
[
-f
$cnetfile
]
;
then
cnetif
=
`
cat
$cnetfile
`
echo
"
`
date
`
:
$iface
:
$cnetfile
already had
$cnetif
"
>>
$LOGDIR
/dhclient.log
elif
static_widearea_config
$iface
;
then
#
# Make sure that static_widearea_config matched $iface to the target WA_MAC.
#
if
[
"
$cnetif
"
=
"
$iface
"
]
;
then
echo
$iface
>
$cnetfile
cnetif
=
`
cat
$cnetfile
`
/sbin/initctl emit
-n
'emulab-findcnet-done'
else
#
# If not, don't fail; there was widearea config info; but also don't
# succeed in the final check at the end of the script. This $iface is
# not the control net.
#
cnetif
=
''
fi
else
#
# Find a list of candidate interfaces
#
_iflist
=
`
ifconfig
-a
|
grep
'^eth'
|
awk
'{ print $1 }'
`
echo
"
`
date
`
:
$iface
: findcnet running dhclient on:
$_iflist
"
#
# 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 shutdown all the other interfaces (which
# dhclient will leave "up").
#
if
[
-x
/sbin/dhclient
]
&&
/sbin/dhclient
-q
$_iflist
;
then
killall dhclient
rm
-f
/var/run/dhclient.pid
echo
"
`
date
`
:
$iface
: findcnet dhclient returned"
[
-f
$BOOTDIR
/controlif
]
&&
cp
$BOOTDIR
/controlif
$cnetfile
cnetif
=
`
cat
$cnetfile
`
for
_if
in
$_iflist
;
do
[
$_if
=
$cnetif
]
&&
continue
echo
"
`
date
`
: taking
$_if
down"
ifconfig
$_if
down
done
fi
# 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'
fi
>>
$LOGDIR
/dhclient.log 2>&1
#
# In case ifup/ifdown try to feed us anything
#
while
read
foo bar
;
do
echo
"
`
date
`
:
$iface
: findcnet got
\"
$foo
$bar
\"
from caller"
done
>>
$LOGDIR
/dhclient.log 2>&1
if
[
-z
"
$cnetif
"
]
;
then
echo
"
`
date
`
:
$iface
: findcnet got empty
$cnetfile
"
>>
$LOGDIR
/dhclient.log
fi
echo
"
`
date
`
:
$iface
: cnet is
$cnetif
"
>>
$LOGDIR
/dhclient.log
if
[
"
$cnetif
"
=
$iface
]
;
then
echo
cnet
else
echo
$iface
fi
rm
-rf
$lockdir
exit
0