Commit 3ba294d9 authored by Mike Hibler's avatar Mike Hibler

Add machinery to automatically setup mrouted on the control network.

This is specifically intended for elabinelab right now where configurations
with an "inner control network" need a multicast router for inner frisbee
to work. There is (an undocumented) NEEDMROUTED defs variable that controls
whether the machinery is triggered or not. It is not documented because, though
in theory this would work for a real boss setup, it has not been tested and
each install would probably need a custom mrouted.conf file.

For an inner elab, this variable is automatically set in defs-elabinelab
if there is an inner control network. The result is that the mrouted port
will be installed, it will be enabled in rc.conf, and a stub mrouted.conf
file is created (to force mrouted to ignore the real control network).
parent be15f9bc
......@@ -1500,6 +1500,8 @@ done
......@@ -1594,6 +1596,7 @@ NOSTACKMIB=0
NOSHAREDFS=0
NFSRACY=1
SELFLOADER_DATA="__DATA__"
NEEDMROUTED=0
#
# XXX You really don't want to change these!
......@@ -2231,17 +2234,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2234: checking for $ac_hdr" >&5
echo "configure:2238: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2239 "configure"
#line 2243 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2280,17 +2283,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2283: checking for $ac_hdr" >&5
echo "configure:2287: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2288 "configure"
#line 2292 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2323,7 +2326,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2326: checking for $ac_word" >&5
echo "configure:2330: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2380,7 +2383,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:2383: checking how to run the C++ preprocessor" >&5
echo "configure:2387: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2393,12 +2396,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
#line 2396 "configure"
#line 2400 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
......@@ -2424,17 +2427,17 @@ echo "$ac_t""$CXXCPP" 1>&6
ac_safe=`echo "xercesc/dom/DOM.hpp" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for xercesc/dom/DOM.hpp""... $ac_c" 1>&6
echo "configure:2427: checking for xercesc/dom/DOM.hpp" >&5
echo "configure:2431: checking for xercesc/dom/DOM.hpp" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2432 "configure"
#line 2436 "configure"
#include "confdefs.h"
#include <xercesc/dom/DOM.hpp>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2498,7 +2501,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2501: checking for a BSD compatible install" >&5
echo "configure:2505: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2559,7 +2562,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2562: checking for $ac_word" >&5
echo "configure:2566: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -3063,7 +3066,6 @@ s%@TBCOOKIESUFFIX@%$TBCOOKIESUFFIX%g
s%@TBAUTHDOMAIN@%$TBAUTHDOMAIN%g
s%@TBAUTHTIMEOUT@%$TBAUTHTIMEOUT%g
s%@TBMAINSITE@%$TBMAINSITE%g
s%@TBUSEDBI@%$TBUSEDBI%g
s%@FANCYBANNER@%$FANCYBANNER%g
s%@SFSSUPPORT@%$SFSSUPPORT%g
s%@ELABINELAB@%$ELABINELAB%g
......@@ -3135,6 +3137,8 @@ s%@NOSTACKMIB@%$NOSTACKMIB%g
s%@EXP_VIS_SUPPORT@%$EXP_VIS_SUPPORT%g
s%@NOSHAREDFS@%$NOSHAREDFS%g
s%@SELFLOADER_DATA@%$SELFLOADER_DATA%g
s%@TBUSEDBI@%$TBUSEDBI%g
s%@NEEDMROUTED@%$NEEDMROUTED%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBROBOCOPSEMAIL@%$TBROBOCOPSEMAIL%g
......
......@@ -222,6 +222,7 @@ AC_SUBST(EXP_VIS_SUPPORT)
AC_SUBST(NOSHAREDFS)
AC_SUBST(SELFLOADER_DATA)
AC_SUBST(TBUSEDBI)
AC_SUBST(NEEDMROUTED)
#
# Offer both versions of the email addresses that have the @ escaped
......@@ -314,6 +315,7 @@ NOSTACKMIB=0
NOSHAREDFS=0
NFSRACY=1
SELFLOADER_DATA="__DATA__"
NEEDMROUTED=0
#
# XXX You really don't want to change these!
......
......@@ -55,6 +55,8 @@ OUTERBOSS_NODENAME=changeme
TBCOOKIESUFFIX=changeme
# XXX hack to work around perl bug
SELFLOADER_DATA=changeme
# Start a multicast router
NEEDMROUTED=changeme
TBUSEDBI=1
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003-2010 , 2011, 2011University of Utah and the Flux Group.
# Copyright (c) 2003-2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -43,6 +43,8 @@ my $SCRATCHDIR = '@FSDIR_SCRATCH@';
my $SHAREDIR = '@FSDIR_SHARE@';
my $FRISADDR = '@FRISEBEEMCASTADDR@';
my $NEEDMROUTED = @NEEDMROUTED@;
#
# Fixed paths for clients
#
......@@ -538,6 +540,15 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $PYM2_PKG");
};
}
if ($NEEDMROUTED && $FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
Phase "mrouted", "Installing mrouted", sub {
if (!ExecQuiet("$PKG_INFO -x mrouted")) {
PhaseSkip("mrouted already installed");
}
my $pname = GetPackage("mrouted", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
}
}
else {
......@@ -1105,6 +1116,11 @@ Phase "rc.conf", "Adding testbed content to $RCCONF", sub {
push(@strings, (qq|static_routes="\$static_routes frisbee"|,
qq|route_frisbee="-net $o1.0.0.0/8 -iface $BOSSNODE_IP"|));
# enable mrouted if needed
if ($NEEDMROUTED) {
push(@strings, qq|mrouted_enable="YES"|);
}
AppendToFileFatal($RCCONF, @strings);
};
......
......@@ -154,6 +154,10 @@ my $SINGLE_CONTROLNET = 0;
# Support a shared filesystem between fs server and nodes
my $SHAREDFS = 1;
# Start up mrouted so frisbee works (if there is no other mcast router)
# -1 means let the system decide.
my $NEEDMROUTED= -1;
#
# Defaults for configuration attributes (options).
# These can be overridden if values are passed in via the emulabconfig command.
......@@ -184,6 +188,7 @@ my %emulabconfig = (
# CONFIG_USERDB support integrated MySQL DB (part of COLLAB)
# CONFIG_WIKI support integrated wiki (part of COLLAB)
# CONFIG_SHAREDFS support shared filesystem
# CONFIG_MROUTED install/configure multicast router
#
"CONFIG_NOSETUP" => $NOSETUP,
"CONFIG_SCRATCHFS" => $SCRATCHFS,
......@@ -198,6 +203,7 @@ my %emulabconfig = (
"CONFIG_USERDB" => !$NOCOLLAB,
"CONFIG_WIKI" => !$NOCOLLAB,
"CONFIG_SHAREDFS" => $SHAREDFS,
"CONFIG_MROUTED" => $NEEDMROUTED,
#
# Elabinelab build options:
......@@ -1595,6 +1601,19 @@ sub SetupBossNode()
RecreateDir("/packages", 1);
mysystem("mount ${fsname}:" . $emulabconfig{BOSS_PKG_DIR} . " /packages");
#
# Determine if we need to run a multicast router.
# We will if: 1) using a private control net and 2) kernel support mroute
#
if ($emulabconfig{"CONFIG_MROUTED"} == -1) {
if (!$emulabconfig{"CONFIG_SINGLECNET"} &&
!system("sysctl -N net.inet.ip.mrtstat 2>&1")) {
$emulabconfig{"CONFIG_MROUTED"} = 1;
} else {
$emulabconfig{"CONFIG_MROUTED"} = 0;
}
}
#
# Need to create an /etc/rc.conf that is more suitable for boss.
# I took most of this from our real boss node. It will be modified
......@@ -1735,6 +1754,23 @@ sub SetupBossNode()
" '(cat >> /root/.ssh/authorized_keys)'")
if ($emulabconfig{"OPSIP"} ne $emulabconfig{"FSIP"});
#
# Need to tweak mrouted.conf as appropriate for an inner-elab
# (ignore the real control net, otherwise we will get ALL mcast traffic
# in the testbed delivered to our doorstep!)
#
if ($emulabconfig{"CONFIG_MROUTED"}) {
# make sure old "standard" mrouted doesn't interfere with port
if (-r "/usr/local/etc/rc.d/mrouted" && -r "/etc/rc.d/mrouted") {
unlink("/etc/rc.d/mrouted");
}
if (-x "/usr/local/sbin/mrouted" && -x "/usr/sbin/mrouted") {
unlink("/usr/sbin/mrouted");
}
mysystem("echo 'phyint $outer_controlif force_leaf noflood deny 0/0 bidir' >> /usr/local/etc/mrouted.conf");
}
#
# XXX Remove conflicting package installed by boss-install.
# This can go away when the emulab-boss port has been updated.
......@@ -2139,6 +2175,14 @@ sub CreateDefsFile($)
}
last SWITCH;
};
/^NEEDMROUTED$/ && do {
if ($emulabconfig{"CONFIG_MROUTED"} == 1) {
print OUTDEFS "NEEDMROUTED=1\n";
} else {
print OUTDEFS "NEEDMROUTED=0\n";
}
last SWITCH;
};
print OUTDEFS $line;
}
......
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