Skip to content
Snippets Groups Projects
Commit 3afcab05 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

dhclient changes for ElabInElab. The crux of this is that inner

nodes are treated specially. For inner boss/ops, ignore most of what
DHCPD returns; we need to do the DHCP so that we know what interface,
but for the moment stuff is hardwired into /etc/rc.conf when the inner
boss and ops are created. I can probably fix this up later as needed,
to be more dynamic for supporting swapout/swapin of an inner emulab,
but swapout and restore of an inner elab has som many open issues,
that not worrying about it now.

For inner nodes, the change is simple; If no hostname provided, ignore
the DHCPD reply completely, favoring a full reply from the inner
control network, and returning -1 from the exit hook so that dhclient
keeps trying in the foreground.

I am committing these so they get into new images.
parent 8226588f
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,8 @@ sysetc-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
$(SYSETCDIR)/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks \
$(SYSETCDIR)/dhclient-enter-hooks
$(INSTALL) -m 755 $(SRCDIR)/periodic.conf $(SYSETCDIR)/periodic.conf
$(INSTALL) -m 755 $(SRCDIR)/testbed.sh $(RCDIR)/testbed.sh
$(INSTALL) -m 755 $(SRCDIR)/elvind.sh $(RCDIR)/elvind.sh
......
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
if [ x$reason != xREBOOT -a x$reason != xBOUND -a x$reason != xRENEW ]
then
return 0
fi
#
# ElabinElab support.
#
if [ -e "$ETCDIR/outer_bossnode" ]; then
#
# On inner boss/ops, we do not accept the following from the DHCPD
# server on outer boss. This stuff has been setup in /etc/rc.conf
# when the inner boss/ops was created.
#
unset new_host_name
unset new_domain_name_servers
unset new_domain_name
unset new_routers
elif [ "$new_host_name" = "" ]; then
#
# Otherwise, if no hostname provided, it means that its an outer emulab
# returning DHCPD info, in which case we want to again ignore most of the
# info since all we want to do is configure the interface.
#
new_static_routes="$new_dhcp_server_identifier $new_routers"
unset new_domain_name_servers
unset new_domain_name
unset new_routers
new_subnet_mask="255.255.255.0"
#
# Ack, changed my mind. This is a pain in the ass. For now do not
# configure the outer interface; worry about it later.
#
exit_status=1
return
fi
return 0
......@@ -11,6 +11,35 @@ then
exit 0
fi
#
# ElabinElab support
#
if [ -e "$ETCDIR/outer_bossnode" ]; then
#
# Inner boss or ops. The outer network has now been configured.
# Call rc.inelab to get the inner control network configured (we
# have to ask outer boss in the usual manner).
#
$BINDIR/rc/rc.inelab >$LOGDIR/dhclient.log 2>&1
# Then kill as we normally do.
killall dhclient >>$LOGDIR/dhclient.log 2>&1
exit 0
elif [ "$new_host_name" = "" ]; then
#
# Otherwise, if no hostname provided, it means that its an outer emulab
# returning DHCPD info, in which case all we want to do is configure the
# interface, but not allow dhclient to think it has finished its job.
# So, exit with non-zero status and dhclient will keep trying to configure
# another interface (the inner control network). This assumes this
# was the first interface to respond. If the inner control interface
# came up first, then dhclient is already in the background. See below;
# we are going to let dhclient keep running.
#
exit 1
fi
#
# Remember our server IP, real hostname, router IP, etc.
#
......@@ -35,7 +64,7 @@ fi
#
# Once we have an IP address, we can stop dhclient so that it doesn't get
# in the way
# in the way.
#
# I'd love to use the dhclient.pid file, but it helpfully has not been
# created at this point
......
......@@ -4,6 +4,7 @@
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
#
# Sweet! dhclient on linux wants to DHCP on the loopback interface
......@@ -11,4 +12,31 @@
#
if [ xxx$interface = xxxlo ]; then
exit_status=1
return
fi
if [ x$reason != xREBOOT -a x$reason != xBOUND -a x$reason != xRENEW -a x$reason != xREBIND ]
then
return
fi
#
# ElabinElab support.
#
if [ "$new_host_name" = "" ]; then
#
# If no hostname provided, it means that its an outer emulab returning
# DHCPD info, in which case we want to again ignore most of the
# info since all we want to do is configure the interface.
#
new_static_routes="$new_dhcp_server_identifier $new_routers"
unset new_domain_name_servers
unset new_domain_name
unset new_routers
#
# Ack, changed my mind. This is a pain in the ass. For now do not
# configure the outer interface; worry about it later.
#
exit_status=1
return
fi
......@@ -11,6 +11,20 @@ then
exit 0
fi
#
# ElabinElab support
#
if [ "$new_host_name" = "" ]; then
#
# If no hostname provided, it means that its an outer emulab
# returning DHCPD info, in which case all we want to do is configure the
# interface, but not allow dhclient to think it has finished its job.
# So, exit with non-zero status and dhclient will keep trying to configure
# another interface (the inner control network).
#
exit 1
fi
#
# Remember our server IP, real hostname, router IP, etc.
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment