All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 88a2e254 authored by Leigh B Stoller's avatar Leigh B Stoller

Fix conflict

parents b1989b05 e21fc44a
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -139,8 +139,6 @@ my %xmlfields =
"description" => ["description", $SLOT_OPTIONAL],
"path" => ["path", $SLOT_OPTIONAL],
"mtype_*" => ["mtype", $SLOT_OPTIONAL],
#"load_address" => ["load_address", $SLOT_ADMINONLY],
#"frisbee_pid" => ["frisbee_pid", $SLOT_ADMINONLY]
);
#
# Need a list of node types. We join this over the nodes table so that
......@@ -375,31 +373,6 @@ foreach $key (@mtype_keys) {
UserError("Node Types: Must select at least one node type")
if ($node_types_selected == 0);
#
# Only admins can edit the load_address or the frisbee pid.
# XXX: Bring back functionally is some way
#if ($isadmin) {
# if (exists($editimageid_args{"load_address"}) &&
# $editimageid_args{"load_address"} ne "") {
# $foo = escapeshellarg($editimageid_args{"load_address"});
#
# if ($editimageid_args{"load_address"} ne $foo) {
# UserError("Load Address: Contains illegal characters!");
# }
# }
# # Frisbee_pid has already been checked to be a valid int coming from XML.
#}
#else { # Not isadmin.
# if (exists($editimageid_args{"load_address"}) &&
# $editimageid_args{"load_address"} ne $image->load_address()) {
# UserError("Load Address: No permission, admin-only");
# }
# if (exists($editimageid_args{"frisbee_pid"}) &&
# $editimageid_args{"frisbee_pid"} ne $image->frisbee_pid()) {
# UserError("Frisbee PID: No permission, admin-only");
# }
#}
#
# Mereusers are not allowed to create more than one osid/imageid mapping
# for each machinetype. They cannot actually do that through the EZ form
......
......@@ -46,6 +46,8 @@
#undef TPM
#undef NOSHAREDFS
#undef NFSRACY
#undef FRISEBEEMCASTADDR
#undef FRISEBEEMCASTPORT
#undef HAVE_SRANDOMDEV
......
......@@ -1784,6 +1784,14 @@ cat >> confdefs.h <<EOF
#define BOSSEVENTPORT "$BOSSEVENTPORT"
EOF
cat >> confdefs.h <<EOF
#define FRISEBEEMCASTADDR "$FRISEBEEMCASTADDR"
EOF
cat >> confdefs.h <<EOF
#define FRISEBEEMCASTPORT "$FRISEBEEMCASTPORT"
EOF
if test $OPSDBSUPPORT -eq 1; then
cat >> confdefs.h <<EOF
......@@ -2222,17 +2230,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:2226: checking for $ac_hdr" >&5
echo "configure:2234: 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 2231 "configure"
#line 2239 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2244: \"$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*
......@@ -2271,17 +2279,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:2275: checking for $ac_hdr" >&5
echo "configure:2283: 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 2280 "configure"
#line 2288 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2293: \"$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*
......@@ -2314,7 +2322,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:2318: checking for $ac_word" >&5
echo "configure:2326: 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
......@@ -2371,7 +2379,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:2375: checking how to run the C++ preprocessor" >&5
echo "configure:2383: 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
......@@ -2384,12 +2392,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 2388 "configure"
#line 2396 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2401: \"$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
:
......@@ -2415,17 +2423,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:2419: checking for xercesc/dom/DOM.hpp" >&5
echo "configure:2427: 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 2424 "configure"
#line 2432 "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:2429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2437: \"$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*
......@@ -2489,7 +2497,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:2493: checking for a BSD compatible install" >&5
echo "configure:2501: 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
......@@ -2550,7 +2558,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:2554: checking for $ac_word" >&5
echo "configure:2562: 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
......@@ -2673,8 +2681,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \
tbsetup/wanlinkinfo tbsetup/wanassign \
tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \
tbsetup/frisbeelauncher tbsetup/eventsys.proxy tbsetup/frisbeeimage \
tbsetup/subboss_frisbeelauncher tbsetup/subboss_frisbeeimage \
tbsetup/eventsys.proxy \
tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
......@@ -2689,7 +2696,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
tbsetup/assign_wrapper2 \
tbsetup/frisbeelauncher tbsetup/node_update \
tbsetup/node_update \
tbsetup/savelogs tbsetup/setgroups \
tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \
tbsetup/node_control tbsetup/node_attributes \
......
......@@ -406,6 +406,8 @@ if test -n "$FSDIR_SCRATCH"; then
AC_DEFINE_UNQUOTED(FSDIR_SCRATCH, "$FSDIR_SCRATCH")
fi
AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT")
AC_DEFINE_UNQUOTED(FRISEBEEMCASTADDR, "$FRISEBEEMCASTADDR")
AC_DEFINE_UNQUOTED(FRISEBEEMCASTPORT, "$FRISEBEEMCASTPORT")
if test $OPSDBSUPPORT -eq 1; then
AC_DEFINE_UNQUOTED(OPSDBSUPPORT, 1)
......@@ -909,8 +911,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \
tbsetup/wanlinkinfo tbsetup/wanassign \
tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \
tbsetup/frisbeelauncher tbsetup/eventsys.proxy tbsetup/frisbeeimage \
tbsetup/subboss_frisbeelauncher tbsetup/subboss_frisbeeimage \
tbsetup/eventsys.proxy \
tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
......@@ -925,7 +926,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
tbsetup/assign_wrapper2 \
tbsetup/frisbeelauncher tbsetup/node_update \
tbsetup/node_update \
tbsetup/savelogs tbsetup/setgroups \
tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \
tbsetup/node_control tbsetup/node_attributes \
......
......@@ -117,7 +117,7 @@ sub SetGlobalDisable($$)
$value = ($value ? 1 : 0);
DBQueryWarn("update emulab_features set disable='$value' ".
DBQueryWarn("update emulab_features set disabled='$value' ".
"where feature='$featurename'")
or return -1;
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007-2010 University of Utah and the Flux Group.
# Copyright (c) 2007-2011 University of Utah and the Flux Group.
# All rights reserved.
#
package Image;
......@@ -127,9 +127,6 @@ sub part4_osid($) { return field($_[0], "part4_osid"); }
sub default_osid($) { return field($_[0], "default_osid"); }
sub path($) { return field($_[0], "path"); }
sub magic($) { return field($_[0], "magic"); }
#sub load_address($) { return field($_[0], "load_address"); }
#sub frisbee_pid($) { return field($_[0], "frisbee_pid"); }
#sub load_busy($) { return field($_[0], "load_busy"); }
sub ezid($) { return field($_[0], "ezid"); }
sub shared($) { return field($_[0], "shared"); }
sub global($) { return field($_[0], "global"); }
......@@ -139,6 +136,8 @@ sub access_key($) { return field($_[0], "access_key"); }
#
# Get a list of all running frisbee images.
# XXX if this is actually used, it will have to be fixed; DB no longer
# tracks running frisbee daemons.
#
sub ActiveImages($)
{
......@@ -370,7 +369,6 @@ sub EditImageid($$$$)
# (Others above already did their own updates.)
#
my %updates;
#foreach my $col ("description", "path", "load_address", "frisbee_pid" ) {
foreach my $col ("description", "path") {
# Copy args we want so that others can't get through.
if (exists($argref->{$col})) {
......
......@@ -1342,7 +1342,7 @@ sub CheckPortRegistration($) {
my $exptidx;
if (!TBExptIDX($pid, $eid, \$exptidx)) {
print "*** WARNING: No such experiment $pid/$eid!\n";
debug("*** WARNING: No such experiment $pid/$eid!\n");
return;
}
......@@ -1357,16 +1357,29 @@ sub CheckPortRegistration($) {
" sync_server='$vname'");
if ($query_result && $query_result->num_rows) {
# exptidx+service is the primary key, must lookup based on that
$query_result =
DBQueryWarn("select port from port_registration ".
"where pid='$pid' and eid='$eid' and ".
" node_id='$node' and service='emulab_syncd'");
if ($query_result && !$query_result->num_rows) {
DBQueryWarn("insert into port_registration set ".
" exptidx='$exptidx', pid='$pid', eid='$eid', ".
" service='emulab_syncd', ".
" node_id='$node', port='16534'");
DBQueryWarn("select pid,eid,node_id from port_registration ".
"where exptidx='$exptidx' and service='emulab_syncd'");
if ($query_result) {
if (!$query_result->num_rows) {
DBQueryWarn("insert into port_registration set ".
" exptidx='$exptidx', pid='$pid', eid='$eid', ".
" service='emulab_syncd', ".
" node_id='$node', port='16534'");
} else {
#
# XXX check for an existing entry that doesn't match us.
# Some could register as a syncserver from another node
# in the experiment. If so, we just warn for now.
#
my ($p,$e,$n) = $query_result->fetchrow();
if ($p ne $pid || $e ne $eid || $n ne $node) {
info("*** WARNING: portregister sync_server ".
"inconsistancy: $p/$e/$n should be ".
"$pid/$eid/$node\n");
}
}
}
}
}
......
......@@ -191,7 +191,7 @@ if ($SCRATCHDIR) {
my @LOGFILES = ("$LOGDIR/bootinfo.log", "$LOGDIR/tmcd.log",
"$LOGDIR/capture.log", "$LOGDIR/dhcpd.log", "$LOGDIR/capserver.log",
"$LOGDIR/frisbeed.log", "$LOGDIR/proxydhcpd.log",
"$LOGDIR/frisbeed.log", "$LOGDIR/mfrisbeed.log", "$LOGDIR/proxydhcpd.log",
"$LOGDIR/stated.log", "$LOGDIR/osselect.log",
"$LOGDIR/tftpd.log", "$LOGDIR/sdcollectd.log", "$LOGDIR/genlastlog.log",
"$LOGDIR/sshxmlrpc.log", "$LOGDIR/plabgetfree.log", "$LOGDIR/xmlrpcbag.log",
......@@ -834,6 +834,7 @@ Phase "syslog", "Setting up syslog", sub {
"!tftpd", "*.*\t\t\t\t\t\t$LOGDIR/tftpd.log",
"!capserver", "*.*\t\t\t\t\t\t$LOGDIR/capserver.log",
"!frisbeed", "*.*\t\t\t\t\t\t$LOGDIR/frisbeed.log",
"!mfrisbeed", "*.*\t\t\t\t\t\t$LOGDIR/mfrisbeed.log",
"!pubsubd", "*.*\t\t\t\t\t\t$LOGDIR/pubsubd.log",
"!osselect", "*.*\t\t\t\t\t\t$LOGDIR/osselect.log",
"!genlastlog","*.*\t\t\t\t\t\t$LOGDIR/genlastlog.log",
......@@ -882,6 +883,7 @@ Phase "syslog", "Setting up syslog", sub {
"$LOGDIR/osselect.log 640 9 300 * Z",
"$LOGDIR/power.log 640 7 300 * Z",
"$LOGDIR/frisbeed.log 640 7 300 * Z",
"$LOGDIR/mfrisbeed.log 640 7 300 * Z",
"$LOGDIR/tftpd.log 640 7 200 * Z",
"$LOGDIR/dhcpd.log 640 7 200 * Z",
"$LOGDIR/bootinfo.log 640 7 200 * Z",
......
......@@ -49,8 +49,8 @@ my $PGENIUPDATE = "$TB/sbin/protogeni/update";
my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $INSTALLUPDATE= "$TB/sbin/update-install";
my $SETSITEVAR = "$TB/sbin/setsitevar";
my $MFRISBEED = "/usr/local/etc/rc.d/3.mfrisbeed.sh";
my $STARTUP = "/usr/local/etc/rc.d/3.testbed.sh";
my $FRISBEE = "$TB/sbin/frisbeelauncher";
my $tempfile = "/var/tmp/update.$$";
# Protos
......@@ -225,8 +225,7 @@ sub Restart()
}
if ($stopped) {
print "Starting up testbed daemons.\n";
system("$STARTUP start");
if ($?) {
if (system("$MFRISBEED start") || system("$STARTUP start")) {
print "*** Could not restart testbed daemons.\n";
exit(1);
}
......@@ -307,47 +306,12 @@ if ($stopbed) {
sleep(30);
}
print "** Testbed is quiet; stopping testbed daemons ... \n";
system("$STARTUP stop >/dev/null 2>&1");
if ($?) {
if (system("$STARTUP stop >/dev/null 2>&1") ||
system("$MFRISBEED stop >/dev/null 2>&1")) {
Fatal("Could not stop testbed daemons. Stopping.");
}
$stopped = 1;
#
# XXX cannot just call Image->ActiveImages as the implementation
# changed and thus the code would not work when upgrading from a
# code base with the old implementation to one with the new.
#
my $table = "images";
if (!emdb::DBSlotExists("images", "frisbee_pid")) {
$table = "frisbee_blobs";
}
my $query_result =
emdb::DBQueryWarn("select imageid from $table where frisbee_pid!=0");
my @activeimages = ();
if ($query_result) {
while (my ($imageid) = $query_result->fetchrow_array()) {
my $image = Image->Lookup($imageid);
if (!defined($image)) {
print STDERR
"*** Could not find DB object for image $imageid\n";
next;
}
push(@activeimages, $image);
}
}
if (@activeimages > 0) {
print "** Stopping running frisbee processes ...\n";
foreach my $image (@activeimages) {
my $imageid = $image->imageid();
print "-> Killing frisbee for $image ...\n";
system("$FRISBEE -k $imageid");
if ($?) {
Fatal("Could not stop frisbee for $image!");
}
}
}
print "** Testbed is stopped. Proceeding to update\n";
#
......
#
# Do things to set up the frisbee master server.
#
use strict;
use libinstall;
use emdb;
use Image;
use NodeType;
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
my @scripts = (
"frisbeeimage",
"frisbeelauncher",
"subboss_frisbeelauncher_wrapper");
my $gotem = 0;
foreach my $s (@scripts) {
if (-x "$TBROOT/sbin/$s") {
$gotem = 1;
last;
}
}
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
if ($gotem) {
print("\n",
"*** PLEASE NOTE:\n",
"*** To make effective use of the frisbee master server you\n",
"*** will need to update your disk loader MFS(es). You will\n",
"*** need new /etc/testbed/{tmcd,frisbee,rc.frisbee} files.\n",
"*** You can download them from:\n",
"*** http://www.emulab.net/downloads/frisbee-mfs-update.tar.gz\n",
"*** and follow the instructions:\n",
"*** http://users.emulab.net/trac/emulab/wiki/UpdateMFS\n",
"*** or install a completely new MFS from:\n",
"*** http://www.emulab.net/downloads/tftpboot-latest.tar.gz\n",
"\n");
}
}
#
# If something should run in the post-install phase.
#
if ($phase eq "post") {
Phase "clean-DB", "Clean out the old frisbee info", sub {
PhaseFail("Could not clean out frisbee_blobs table")
if (!DBQueryWarn("DELETE FROM frisbee_blobs"));
PhaseSucceed();
};
Phase "clean-scripts", "Clean out old frisbee scripts", sub {
PhaseSkip("already done")
if (!$gotem);
foreach my $s (@scripts) {
unlink("$TBROOT/sbin/$s");
}
PhaseSucceed();
};
}
return 0;
}
1;
......@@ -175,6 +175,12 @@ mydb_update(char *query, ...)
return 1;
}
int
mydb_insertid()
{
return (int)mysql_insert_id(&db);
}
/*
* Map IP to node ID.
*/
......
......@@ -33,6 +33,7 @@ int mydb_seteventschedulerpid(char *pid, char *eid, int processid);
*/
MYSQL_RES *mydb_query(char *query, int ncols, ...);
int mydb_update(char *query, ...);
int mydb_insertid(void);
unsigned long mydb_escape_string(char *to, const char *from,
unsigned long length);
......@@ -33,9 +33,12 @@ endif
endif
endif
WITH_MSERVER_NULL = 1
WITH_MSERVER_EMULAB = 1
include $(OBJDIR)/Makeconf
all: frisbee frisbeed
all: frisbee frisbeed mfrisbeed
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -63,7 +66,24 @@ SERVERFLAGS = $(CFLAGS)
SERVERLIBS = $(PTHREADLIBS)
SERVEROBJS = server.o $(SHAREDOBJS)
CFLAGS = -O2 -g -Wall -fno-builtin-log $(LDSTATIC) $(PTHREADCFLAGS) -DSTATS
#
# Master server configuration
#
# Default master server config
MSERVERFLAGS = -DUSE_NULL_CONFIG $(CFLAGS) -I$(OBJDIR)
MSERVEROBJS = mserver.o $(SHAREDOBJS) config.o config_null.o
MSERVERLIBS =
ifeq ($(WITH_MSERVER_EMULAB),1)
# Emulab master server config
MYSQLCFLAGS = -I/usr/local/include
MYSQLLIBS = -L/usr/local/lib/mysql -lmysqlclient
MSERVERFLAGS += -DUSE_EMULAB_CONFIG -DUSE_LOCALHOST_PROXY $(MYSQLCFLAGS) -I$(TESTBED_SRCDIR)/lib/libtb
MSERVEROBJS += config_emulab.o
MSERVERLIBS += $(OBJDIR)/lib/libtb/libtb.a $(MYSQLLIBS)
endif
CFLAGS = -O2 -g -Wall -fno-builtin-log $(LDSTATIC) $(PTHREADCFLAGS) -DSTATS -DMASTER_SERVER
LDFLAGS = $(LDSTATIC)
#
......@@ -110,6 +130,19 @@ frisbeed-debug: $(SERVEROBJS)
# cp frisbeed frisbeed.debug
# strip frisbeed
mfrisbeed: $(MSERVEROBJS)
$(CC) $(LDFLAGS) $(MSERVERFLAGS) $(MSERVEROBJS) $(MSERVERLIBS) -o mfrisbeed
cp mfrisbeed mfrisbeed.debug
strip mfrisbeed
mserver.o: $(SRCDIR)/mserver.c decls.h configdefs.h utils.h
$(CC) -c $(MSERVERFLAGS) $(SRCDIR)/mserver.c
config.o: $(SRCDIR)/config.c configdefs.h log.h
$(CC) -c $(MSERVERFLAGS) $(SRCDIR)/config.c
config_emulab.o: $(SRCDIR)/config_emulab.c configdefs.h log.h
$(CC) -c $(MSERVERFLAGS) $(SRCDIR)/config_emulab.c
config_null.o: $(SRCDIR)/config_null.c configdefs.h log.h
$(CC) -c $(MSERVERFLAGS) $(SRCDIR)/config_null.c
log.o: $(SRCDIR)/log.c decls.h log.h
$(CC) $(CFLAGS) -DLOG_TESTBED=$(LOG_TESTBED) -c $(SRCDIR)/log.c
......@@ -131,7 +164,7 @@ log.o: decls.h log.h
network.o: decls.h utils.h
trace.o: decls.h trace.h log.h
install: $(INSTALL_SBINDIR)/frisbeed $(INSTALL_SBINDIR)/frisbee
install: $(INSTALL_SBINDIR)/mfrisbeed $(INSTALL_SBINDIR)/frisbeed $(INSTALL_SBINDIR)/frisbee
client: frisbee
......@@ -139,7 +172,7 @@ client-install: client
$(INSTALL_PROGRAM) frisbee $(DESTDIR)$(CLIENT_BINDIR)
clean:
/bin/rm -f *.o *.a frisbee frisbeed frisbee.debug frisbeed.debug
/bin/rm -f *.o *.a frisbee frisbeed mfrisbeed *.debug
/bin/rm -f frisbee.tar frisbee.tar.gz
/bin/rm -rf frisbee-dist
......
The Frisbee "Master Server".
I. Overview:
Frisbee now has a "master" server that listens on a fixed port (64494)
and acts as a rendezvous for all frisbee client requests. The frisbee
client no longer needs to know an address/port in advance, it can
request an image (or file) by name and the master server will authenticate
the request, fire off a frisbee server, and return the address/port to
the client so it can continue as always.
As a result of this, the way frisbee is integrated into Emulab has changed
a bit. Boss now runs the mfrisbeed process at boot time via
/usr/local/etc/rc.d/3.mfrisbeed.sh. The master server is built with the
"Emulab configuration" which allows it to query the Emulab DB to authenticate
requests based on the calling IP address.
The frisbeelauncher program is gone. This program used to be called at
swapin time to start up any frisbeed's well in advance of the nodes booting
and checking in for reload info. Now, frisbeed processes can be started
"just in time" when they contact the master server.
The diskloader ("frisbee") MFS has to be updated to use this. A new tmcc
binary (bumped version number), rc.frisbee (support for calling frisbee
with image name), and frisbee client binary (support for master server)
are needed.
When the MFS makes a "loadinfo" call, tmcd now returns the imagename
rather than address/port info and invokes the frisbee client with that
name. The client contacts the master server with that name, gets back
the address/port and goes on as usual.
II. But, why a master server?
Mostly to eliminate the need for an out-of-band coordination channel for
connecting the client and server. This makes it more useful for transferring
arbitrary files from the server at arbitrary times. Look for more use of
this in the future.
It will also enable uploading of images to the "image repository". This
part is largely done, but hasn't been merged in yet.
Finally this makes frisbee more usable outside of the Emulab context.
Or should..in theory..sometime.
III. How to upgrade and backward compatibility:
You should be able to just clean, reconfigure, rebuild and reinstall your
Emulab software. The update script will remove some old binaries and tell
you how to upgrade your frisbee MFS.
It is not necessary to immediately update your MFS. When an old MFS makes
a "tmcc loadinfo" call, tmcd will see the old version number and invoke a
helper program ("frisbeehelper", duh