Commit 82e7f811 authored by Mike Hibler's avatar Mike Hibler

Use new tmcd "subbossinfo" command to configure.

parent d75093f8
......@@ -5,60 +5,6 @@
# BEFORE: testbed
# KEYWORD: shutdown
#
# XXX there should be a "subbossinfo" tmcd call to return these things:
#
# MCBASEADDR, UNICAST, BANDWIDTH, MCQUERIER, REPORT, ESERVER
#
# which we should stick in a DB table.
#
#
# Base multicast address.
# By default for the null config we use, it is "239.192.1".
# Subbosses on the same network should use different values; e.g., 239.193.1.
#
#MCBASEADDR=""
MCBASEADDR="239.192.1"
#
# Set to use unicast when downloading from boss
#
UNICAST=
#UNICAST=yes
#
# Set to the max bandwidth any instance of frisbeed should use (Mb/sec)
#
BANDWIDTH=
#BANDWIDTH=100000000
#
# Run as an IGMPv2 querier. You should only have one of these per VLAN.
#
MCQUERIER=
#MCQUERIER=yes
#
# Client reporting interval.
# XXX this should come from the sitevar on boss, but for now we hardwire it.
# Unset to disable.
#
#REPORT=
REPORT=60
#
# Event server for client reports.
#
#ESERVER=
ESERVER=boss
#
# Set to run with debugging enabled.
#
#DEBUG=
DEBUG=yes
#
# Start up the frisbee master server on a subboss.
# There is no sure fire way to dynamically tell if we are a subboss right now.
......@@ -69,6 +15,34 @@ DEBUG=yes
# automatically restarted.
#
#
# Default values for configuration variables.
#
# MCBASEADDR: base multicast address.
# Subbosses in the same broadcast domain should use different values to
# avoid confusion; e.g., 239.193.1, 239.194.1, etc.
# Unset to use mfrisbeed default.
# BANDWIDTH: maximum bandwidth any instance of frisbeed should use (Mb/sec).
# Unset to use mfrisbeed default.
# UNICAST: use unicast rather than multicast when downloading from our parent.
# MCQUERIER: run as an IGMPv2 querier.
# You should only have one of these per broadcast domain.
# EVENTSERVER: event server for client progress reports.
# Only used when CLIENTREPORT is non-zero.
# CLIENTREPORT: client progress reporting interval.
# Unset to disable. Set to zero to enable but start with no reports.
# CACHEDIR: local directory for caching images.
# DEBUG: set to run with debugging enabled.
#
MCBASEADDR=239.192.1
BANDWIDTH=100000000
UNICAST=false
MCQUERIER=false
EVENTSERVER=boss
CLIENTREPORT=
CACHEDIR=/z/image_cache
DEBUG=false
. /etc/rc.subr
bindir=@prefix@/sbin
......@@ -112,18 +86,70 @@ esac
echo -n " mfrisbeed"
rm -f /var/run/frisbeed-*.pid
args="-C null -S @BOSSNODE_IP@ -I /z/image_cache -A -M -R"
if [ -n "$UNICAST" ]; then
#
# Get subboss specific overrides via tmcd.
#
SBINFO=
if [ -x "/usr/local/etc/emulab/tmcc" ]; then
SBINFO=`/usr/local/etc/emulab/tmcc -b subbossinfo | grep -i '^frisbee'`
fi
if [ $? -eq 0 ]; then
# XXX note that we do not expect any whitespace in our vals
for kv in $SBINFO; do
# upcase the key; not necessary, just makes me happy
k=`echo ${kv%%=*} | awk '{print toupper($0)}'`
# strip quotes from the val
v="${kv##*=}"
v="${v%\"}"
v="${v#\"}"
# no value, use the default
if [ -z "$v" ]; then
k=SKIP
fi
case $k in
MCBASEADDR)
MCBASEADDR=$v
;;
BANDWIDTH)
BANDWIDTH=$v
;;
UNICAST)
UNICAST=$v
;;
MCQUERIER)
MCQUERIER=$v
;;
EVENTSERVER)
EVENTSERVER=$v
;;
CLIENTREPORT)
CLIENTREPORT=$v
;;
CACHEDIR)
CACHEDIR=$v
;;
DEBUG)
DEBUG=$v
;;
esac
done
fi
args="-C null -S @BOSSNODE_IP@ -I $CACHEDIR -A -M -R"
if [ "$UNICAST" = "true" ]; then
args="$args -X ucast"
fi
if [ -n "$MCQUERIER" ]; then
if [ "$MCQUERIER" = "true" ]; then
args="$args -Q 30"
# XXX it is a v2 querier
sysctl net.inet.igmp.default_version=2
sysctl net.inet.igmp.legacysupp=1
sysctl net.inet.igmp.v2enable=1
fi
if [ -n "$DEBUG" ]; then
if [ "$DEBUG" = "true" ]; then
args="-ddD $args"
fi
......@@ -138,11 +164,10 @@ if [ -n "$BANDWIDTH" ]; then
opts="$opts,bandwidth=$BANDWIDTH"
fi
fi
if [ -n "$REPORT" ]; then
str="report=$REPORT"
if [ -n "$ESERVER" ]; then
str="$str,eventserver=$ESERVER"
if [ -n "$CLIENTREPORT" ]; then
str="report=$CLIENTREPORT"
if [ -n "$EVENTSERVER" ]; then
str="$str,eventserver=$EVENTSERVER"
fi
if [ -z "$opts" ]; then
opts="-O $str"
......@@ -151,7 +176,7 @@ if [ -n "$REPORT" ]; then
fi
fi
if [ -z "$DEBUG" -a -x @prefix@/sbin/daemon_wrapper ]; then
if [ "$DEBUG" != "true" -a -x @prefix@/sbin/daemon_wrapper ]; then
@prefix@/sbin/daemon_wrapper -i 30 -l @prefix@/log/mfrisbeed_wrapper.log \
@prefix@/sbin/mfrisbeed -d $args $opts
else
......
......@@ -13,6 +13,9 @@ DEBUG=yes
#
# Start up the frisbee master server on boss.
# It is expected that the boss mfrisbeed will use config_emulab which
# queries the database directly for configuration parameters.
#
# We run it under the daemon wrapper if available so that it will get
# automatically restarted.
#
......
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