Commit 9aa6b5ca authored by Leigh B. Stoller's avatar Leigh B. Stoller

The bulk of the event system changes.

* The per-experiment event scheduler now runs on ops instead of boss.
  Boss still runs elvind and uses events internally, but the user part
  of the event system has moved.

* Part of the guts of eventsys_control moved to new script, eventsys.proxy,
  which runs on ops and fires off the event scheduler. The only tricky part
  of this is that the scheduler runs as the user, but killing it has to be
  done as root since a different person might swap out the experiment. So,
  the proxy is a perl wrapper invoked from a root ssh from boss, which
  forks, writes the pid file into /var/run/emulab/evsched/$pid_$eid.pid,
  then flips to the user and execs the event scheduler (which is careful
  not to fork). Obviously, if the kill is done as root, the pid file has to
  be stored someplace the user is not allowed to write.

* The event scheduler has been rewritten to use Tim's C++ interface to the
  sshxmlrpc server on boss. Actually, I reorg'ed the scheduler so that it
  can be built either as a mysql client, or as RPC client. Note that it can
  also be built to use the SSL version of the XMLRPC server, but that will
  not go live until I finish the server stuff up. Also some goo for dealing
  with building the scheduler with C++.

* Changes to several makefiles to install the ops binaries over NFS to
  /usr/testbed/opsdir. Makes life easier, but only if boss and ops are
  running the same OS. For now, using static linking on the event scheduler
  until ops upgraded to same rev as boss.

* All of the event clients got little tweaks for dealing with the new CNAME
  for the event system server (event-sever). Will need to build new images
  at some point. Old images and clients will continue to work cause of an
  inetd hack on boss that uses netcat to transparently redirect elvind
  connections to ops.

* Note that eventdebug needs some explaining. In order to make the inetd
  redirect work, elvind cannot be listening on the standard port. So, the
  boss event system uses an alternate port since there are just a few
  subsystems on boss that use the server, and its easy to propogate changes
  on boss. Anyway, the default for eventdebug is to connect to the standard
  port on localhost, which means it will work as expected on ops, but will
  require -b argument on boss.

* Linktest changes were slightly more involved. No longer run linktest on
  boss when called from the experiment swapin path, but ssh over to ops to
  fire it off. This is done as the user of course, and there are some
  tricks to make it possible to kill a running linktest and its ssh when
  experiment swapin is canceled (or from the command line) by forcing
  allocation of a tty. I will probably revisit this at some point, but I
  did not want to spend a bunch of time on linktest.

* The upgrade path detailed in doc/UPDATING is necessarily complicated and
  bound to cause consternation at remote sites doing an upgrade.
parent a239e6ec
...@@ -1099,7 +1099,7 @@ if test -z "$THISHOMEBASE"; then ...@@ -1099,7 +1099,7 @@ if test -z "$THISHOMEBASE"; then
THISHOMEBASE="Emulab.Net" THISHOMEBASE="Emulab.Net"
fi fi
if test -z "$EVENTSERVER"; then if test -z "$EVENTSERVER"; then
EVENTSERVER="$BOSSNODE" EVENTSERVER="event-server"
fi fi
cat >> confdefs.h <<EOF cat >> confdefs.h <<EOF
#define EVENTSERVER "$EVENTSERVER" #define EVENTSERVER "$EVENTSERVER"
...@@ -1249,6 +1249,7 @@ if test "$enable_events" = "no"; then ...@@ -1249,6 +1249,7 @@ if test "$enable_events" = "no"; then
else else
eventfiles="event/GNUmakefile event/lib/GNUmakefile \ eventfiles="event/GNUmakefile event/lib/GNUmakefile \
event/etc/elvind-boss.conf event/etc/elvind-ops.conf \ event/etc/elvind-boss.conf event/etc/elvind-ops.conf \
event/etc/elvind-inetd.conf event/etc/GNUmakefile\
event/sched/GNUmakefile event/test/GNUmakefile \ event/sched/GNUmakefile event/test/GNUmakefile \
event/tbgen/GNUmakefile \ event/tbgen/GNUmakefile \
event/example/GNUmakefile event/example/tbsend.pl \ event/example/GNUmakefile event/example/tbsend.pl \
......
...@@ -243,7 +243,7 @@ if test -z "$THISHOMEBASE"; then ...@@ -243,7 +243,7 @@ if test -z "$THISHOMEBASE"; then
THISHOMEBASE="Emulab.Net" THISHOMEBASE="Emulab.Net"
fi fi
if test -z "$EVENTSERVER"; then if test -z "$EVENTSERVER"; then
EVENTSERVER="$BOSSNODE" EVENTSERVER="event-server"
fi fi
AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER") AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER")
...@@ -358,6 +358,7 @@ if test "$enable_events" = "no"; then ...@@ -358,6 +358,7 @@ if test "$enable_events" = "no"; then
else else
eventfiles="event/GNUmakefile event/lib/GNUmakefile \ eventfiles="event/GNUmakefile event/lib/GNUmakefile \
event/etc/elvind-boss.conf event/etc/elvind-ops.conf \ event/etc/elvind-boss.conf event/etc/elvind-ops.conf \
event/etc/elvind-inetd.conf event/etc/GNUmakefile\
event/sched/GNUmakefile event/test/GNUmakefile \ event/sched/GNUmakefile event/test/GNUmakefile \
event/tbgen/GNUmakefile \ event/tbgen/GNUmakefile \
event/example/GNUmakefile event/example/tbsend.pl \ event/example/GNUmakefile event/example/tbsend.pl \
......
...@@ -6,6 +6,124 @@ This file is in the same format at the FreeBSD UPDATING file, whis is ...@@ -6,6 +6,124 @@ This file is in the same format at the FreeBSD UPDATING file, whis is
to say, in reverse chronological order, with the date of the change to say, in reverse chronological order, with the date of the change
in YYYYMMDD format. in YYYYMMDD format.
20040816:
The event system has moved to users.emulab.net.
* Install the elvin libraries and daemon on users.emulab.net.
* Pick up this package:
http://boss.emulab.net/downloads/ulsshxmlrpcpp-0.1.0.tar.gz
cd /someplace
tar zxf ulsshxmlrpcpp-0.1.0.tar.gz
cd ulsshxmlrpcpp-0.1.0
configure
gmake
sudo gmake install
* Reconfig, rebuild, and reinstall the testbed software on your
boss node.
* Reconfig, rebuild, and reinstall the testbed software on your
users node.
ssh users
cd /your/object/tree/obj/
gmake
gmake control-install
cd /your/object/tree/obj/event/etc
sudo gmake control-install
* Install the new elvind config file on boss and restart elvind
Note that this is not done as part of toplevel install.
cd /your/object/tree/obj/event/etc
sudo gmake install
sudo /usr/local/etc/rc.d/2.elvind.sh stop
sudo /usr/local/etc/rc.d/2.elvind.sh start
* Restart tmcd and stated on boss (note that if you plan to just
reboot boss, a lot of these steps can be skipped).
sudo /usr/testbed/sbin/tmcd.restart
sudo kill -USR1 `cat /var/run/stated.pid`
* Install the elvind config file on users.
Note that this is not done as part of toplevel install.
ssh users
cd /your/object/tree/obj/event/etc
sudo gmake control-install
* Install new rc.d file on boss.
Note that this is not done as part of toplevel install.
cd /your/object/tree/obj/rc.d
sudo gmake install
* Install the rc.d file that starts elvind on users.
Note that this is not done as part of toplevel install.
ssh users
cd /your/object/tree/obj/rc.d
sudo gmake control-install
* Start the elvin server on users.emulab.net:
ssh users
sudo /usr/local/etc/rc.d/2.elvind.sh
* Create the ops certificate (on boss) and copy it to your users node.
cd /your/object/tree/obj/ssl
gmake ctrlnode.pem
sudo scp ctrlnode.pem users:/etc/emulab/client.pem
sudo ssh users chmod 600 /etc/emulab/client.pem
sudo scp emulab.pem users:/etc/emulab
* Install the tmcd client stuff on users.emulab.net.
ssh users.emulab.net
cd /your/object/tree/obj/tmcd/freebsd
sudo gmake control-install
* Create the emulab-ops/opsnode experiment. Do this the same way
that hwdown is created in setup-db.txt.
* Create a node_types entry for ops. This is mostly just a stub
entry so that tmcd will recognize it and so that other parts of
the system are happy. Be sure that you get the interface correct,
and set the Default OSID to emulab-ops/OPSNODE-BSD. The type is
ops and the class is misc.
* Create the ops node nodes table entry ...
* Place the ops node into the above experiment:
wap nalloc emulab-ops opsnode ops
* Make sure that netcat is installed.
cd /usr/ports/net/netcat
sudo make
sudo make install
* Add entry to /etc/services for elvin:
elvin 2917/tcp
* Change the CNAME event-server to your zone file from boss to ops.
event-server IN CNAME ops
* Start the alternate inetd service so that old images trying to
connect to the event server are redirected to users.emulab.net.
Be sure to replace boss.foo.bar with the right name.
sudo inetd -a boss.foo.bar -p /var/run/testbed-inetd.pid \
/usr/testbed/etc/inetd.conf
20040815: 20040815:
After some changes to ptopgen, you'll need to run the following SQL After some changes to ptopgen, you'll need to run the following SQL
command to keep vnodes working properly: command to keep vnodes working properly:
......
...@@ -19,7 +19,7 @@ ifeq ($(SYSTEM),FreeBSD) ...@@ -19,7 +19,7 @@ ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += sched delay-agent nsetrafgen stated SUBDIRS += sched delay-agent nsetrafgen stated
endif endif
all: trafgen-fetch all-subdirs all: etc-subdir trafgen-fetch all-subdirs
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
...@@ -29,6 +29,9 @@ include $(TESTBED_SRCDIR)/GNUmakerules ...@@ -29,6 +29,9 @@ include $(TESTBED_SRCDIR)/GNUmakerules
trafgen-fetch: trafgen-fetch:
$(SRCDIR)/trafgen/tg-install $(SRCDIR)/trafgen $(SRCDIR)/trafgen/tg-install $(SRCDIR)/trafgen
etc-subdir:
@$(MAKE) -C etc all
install: install:
@$(MAKE) -C lib install @$(MAKE) -C lib install
@$(MAKE) -C sched install @$(MAKE) -C sched install
...@@ -42,6 +45,8 @@ client-install: client client-install-subdirs ...@@ -42,6 +45,8 @@ client-install: client client-install-subdirs
control-install: control-install:
@$(MAKE) -C lib control-install @$(MAKE) -C lib control-install
@$(MAKE) -C tbgen control-install @$(MAKE) -C tbgen control-install
@$(MAKE) -C sched control-install
@$(MAKE) -C linktest install
clean: clean-subdirs clean: clean-subdirs
distclean: distclean-subdirs distclean: distclean-subdirs
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group. * Copyright (c) 2000-2004 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -70,7 +70,7 @@ char buf_link [MAX_LINKS][MAX_LINE_LENGTH]; ...@@ -70,7 +70,7 @@ char buf_link [MAX_LINKS][MAX_LINE_LENGTH];
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char c; char c;
char *server = NULL; char *server = "localhost";
char * port = NULL; char * port = NULL;
char *map_file = NULL; char *map_file = NULL;
char *log_file = "/tmp/agentlog"; char *log_file = "/tmp/agentlog";
......
...@@ -15,18 +15,19 @@ use Getopt::Std; ...@@ -15,18 +15,19 @@ use Getopt::Std;
use strict; use strict;
sub usage { sub usage {
warn "Usage: $0 [-s server] [-p port] <event>\n"; warn "Usage: $0 [-b] [-s server] [-p port] <event>\n";
return 1; return 1;
} }
my %opt = (); my %opt = ();
getopt("s:p:h", \%opt); getopt("s:p:hb", \%opt);
if ($opt{h}) { exit &usage; } if ($opt{h}) { exit &usage; }
if (@ARGV) { exit &usage; } if (@ARGV) { exit &usage; }
my ($server,$port); my ($server,$port);
if ($opt{s}) { $server = $opt{s}; } else { $server = "boss"; } if ($opt{s}) { $server = $opt{s}; } else { $server = "localhost"; }
if ($opt{b}) { $port = @BOSSEVENTPORT@ ; }
if ($opt{p}) { $port = $opt{p}; } if ($opt{p}) { $port = $opt{p}; }
my $URL = "elvin://$server"; my $URL = "elvin://$server";
......
...@@ -26,7 +26,7 @@ if ($opt{h}) { exit &usage; } ...@@ -26,7 +26,7 @@ if ($opt{h}) { exit &usage; }
if (@ARGV) { exit &usage; } if (@ARGV) { exit &usage; }
my ($server,$port); my ($server,$port);
if ($opt{s}) { $server = $opt{s}; } else { $server = "boss"; } if ($opt{s}) { $server = $opt{s}; } else { $server = "localhost"; }
if ($opt{p}) { $port = $opt{p}; } if ($opt{p}) { $port = $opt{p}; }
my $URL = "elvin://$server"; my $URL = "elvin://$server";
......
...@@ -25,7 +25,7 @@ if ($opt{h}) { exit &usage; } ...@@ -25,7 +25,7 @@ if ($opt{h}) { exit &usage; }
if (@ARGV != 1) { exit &usage; } if (@ARGV != 1) { exit &usage; }
my ($server,$port); my ($server,$port);
if ($opt{s}) { $server = $opt{s}; } else { $server = "boss"; } if ($opt{s}) { $server = $opt{s}; } else { $server = "localhost"; }
if ($opt{p}) { $port = $opt{p}; } if ($opt{p}) { $port = $opt{p}; }
my $URL = "elvin://$server"; my $URL = "elvin://$server";
......
...@@ -106,9 +106,10 @@ _tbevent.so: event.o event_wrap_py.o util.o ...@@ -106,9 +106,10 @@ _tbevent.so: event.o event_wrap_py.o util.o
LIB_STUFF = event.pm event.so tbevent.py _tbevent.so LIB_STUFF = event.pm event.so tbevent.py _tbevent.so
install: $(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF)) install: $(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF)) \
$(addprefix $(INSTALL_DIR)/opsdir/lib/, $(LIB_STUFF))
control-install: install control-install: $(addprefix $(INSTALL_LIBDIR)/, $(LIB_STUFF))
# #
# Right now we don't bother with the dynamic libs since all of the existing # Right now we don't bother with the dynamic libs since all of the existing
...@@ -129,3 +130,8 @@ client-libinstall: ...@@ -129,3 +130,8 @@ client-libinstall:
clean: clean:
/bin/rm -f *.o libevent.a libevent_r.a *.so *.py swig-pywrappers /bin/rm -f *.o libevent.a libevent_r.a *.so *.py swig-pywrappers
$(INSTALL_DIR)/opsdir/lib/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_DIR)/opsdir/lib
$(INSTALL) $< $@
...@@ -85,7 +85,9 @@ install: ...@@ -85,7 +85,9 @@ install:
$(INSTALL_PROGRAM) $(SCRIPT_CONTROL) $(INSTALL_SBINDIR) $(INSTALL_PROGRAM) $(SCRIPT_CONTROL) $(INSTALL_SBINDIR)
$(INSTALL_DATA) $(SRCDIR)/linktest.html $(INSTALL_WWWDIR)/doc $(INSTALL_DATA) $(SRCDIR)/linktest.html $(INSTALL_WWWDIR)/doc
control-install: install control-install:
$(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(LTEVENT) $(INSTALL_LIBEXECDIR)
$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(INSTALL_BINDIR)
client: all client: all
client-install: client client-install: client
......
...@@ -50,6 +50,7 @@ use constant PATH_PATHRATE_RCV => "/usr/local/bin/pathrate_rcv"; ...@@ -50,6 +50,7 @@ use constant PATH_PATHRATE_RCV => "/usr/local/bin/pathrate_rcv";
use constant PATH_EMULAB_SYNC => "@CLIENT_BINDIR@/emulab-sync"; use constant PATH_EMULAB_SYNC => "@CLIENT_BINDIR@/emulab-sync";
use constant PATH_LTEVENT => "@CLIENT_BINDIR@/ltevent"; use constant PATH_LTEVENT => "@CLIENT_BINDIR@/ltevent";
use constant RUN_PATH => "@CLIENT_BINDIR@"; # where the linktest-ns runs. use constant RUN_PATH => "@CLIENT_BINDIR@"; # where the linktest-ns runs.
use constant EVENTSERVER => "@EVENTSERVER@";
# log files used by tests. # log files used by tests.
use constant CRUDE_DAT => "/tmp/crude.dat"; # binary data use constant CRUDE_DAT => "/tmp/crude.dat"; # binary data
...@@ -140,7 +141,6 @@ my $debug_level = 0; # enable debug statements ...@@ -140,7 +141,6 @@ my $debug_level = 0; # enable debug statements
# 1 = print debug statements. # 1 = print debug statements.
# 2 = show STDOUT and STDERR # 2 = show STDOUT and STDERR
my $barr_count; # used by synserv host, nubmer of hosts -1 my $barr_count; # used by synserv host, nubmer of hosts -1
my $event_server; # event server
my $log_file; # common logfile for information saved over time. my $log_file; # common logfile for information saved over time.
my @hosts; # hosts: list of text strings containing host names. my @hosts; # hosts: list of text strings containing host names.
...@@ -232,16 +232,6 @@ die("Could not locate an emulab-sync server\n") unless -e $ssname; ...@@ -232,16 +232,6 @@ die("Could not locate an emulab-sync server\n") unless -e $ssname;
($synserv) = split/\./, $results[0]; ($synserv) = split/\./, $results[0];
chomp $synserv; chomp $synserv;
#
# Execute tmcc to find out the name of the event server.
#
@results = &my_tick("@CLIENT_BINDIR@/tmcc","bossinfo");
if(@results && $results[0] =~ /^([\w\.]*)\s/) {
$event_server = $1;
} else {
die("Could not determine event server name\n");
}
# #
# If the current node is the special node (arbitrarily the sync # If the current node is the special node (arbitrarily the sync
# server node), do some housekeeping and run ns to generate # server node), do some housekeeping and run ns to generate
...@@ -931,7 +921,6 @@ sub get_topo { ...@@ -931,7 +921,6 @@ sub get_topo {
# prints out the topology read in from the NS file # prints out the topology read in from the NS file
sub debug_top { sub debug_top {
&debug("ns script: $ns_file\n"); &debug("ns script: $ns_file\n");
&debug("event server: $event_server\n");
&debug("nodes:\n"); &debug("nodes:\n");
foreach my $vert (@hosts) { foreach my $vert (@hosts) {
&debug( " " . $vert . "\n"); &debug( " " . $vert . "\n");
...@@ -1102,7 +1091,7 @@ sub post_event { ...@@ -1102,7 +1091,7 @@ sub post_event {
if($hostname eq $synserv) { if($hostname eq $synserv) {
system(PATH_LTEVENT, system(PATH_LTEVENT,
"-s", "-s",
$event_server, EVENTSERVER,
"-e", "-e",
"$proj_id/$exp_id", "$proj_id/$exp_id",
"-k", "-k",
......
...@@ -17,17 +17,19 @@ use POSIX; ...@@ -17,17 +17,19 @@ use POSIX;
# #
sub usage() sub usage()
{ {
print("Usage: linktest_control [-d] [-k | -l <level>] [-o <file>] ". print("Usage: linktest_control [-d] [-t timeout] [-k | -l <level>] ".
"<pid> <eid>\n". "[-o <file>] <pid> <eid>\n".
"-l - Run linktest at a specific level; defaults to DB value.\n". "-l - Run linktest at a specific level; defaults to DB value.\n".
"-k - Kill a currently running linktest.\n". "-k - Kill a currently running linktest.\n".
"-t - Specify timeout in seconds.\n".
"-o - Specify output file for linktest results.\n". "-o - Specify output file for linktest results.\n".
"-d - Turn on debugging output.\n"); "-d - Turn on debugging output.\n");
exit(-1); exit(-1);
} }
my $optlist = "dkl:o:"; my $optlist = "dkl:o:t:";
my $debug = 0; my $debug = 0;
my $cancel = 0; my $cancel = 0;
my $timeout;
my $level; my $level;
my $output; my $output;
my $child_pid; # Child run_linktest process. my $child_pid; # Child run_linktest process.
...@@ -37,6 +39,8 @@ my $child_pid; # Child run_linktest process. ...@@ -37,6 +39,8 @@ my $child_pid; # Child run_linktest process.
# #
my $TB = "@prefix@"; my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $CONTROL = "@USERNODE@";
my $SSH = "$TB/bin/sshtb";
# #
# Testbed Support libraries # Testbed Support libraries
...@@ -68,6 +72,16 @@ if (defined($options{"d"})) { ...@@ -68,6 +72,16 @@ if (defined($options{"d"})) {
if (defined($options{"k"})) { if (defined($options{"k"})) {
$cancel = 1; $cancel = 1;
} }
if (defined($options{"t"})) {
$timeout = $options{"t"};
if ($timeout =~ /^(\d*)$/) {
$timeout = $1;
}
else {
die("Bad data in timeout: $timeout");
}
}
if (defined($options{"l"})) { if (defined($options{"l"})) {
$level = $options{"l"}; $level = $options{"l"};
...@@ -209,12 +223,23 @@ if ($child_pid) { ...@@ -209,12 +223,23 @@ if ($child_pid) {
} }
# #
# Child execs run_linktest. # Child execs an ssh to users.emulab.net where linktest is actually run.
# We tell ssh to allocate a tty so that we can kill it with TERM and have
# everything die off properly.
# #
exec "$TB/bin/run_linktest.pl", my $cmd = "$SSH -t -host $CONTROL $TB/bin/run_linktest.pl -v";
("-d", $debug, "-v"), $cmd .= " -d $debug"
(defined($output) ? ("-o", $output) : ()), if ($debug);
("-l", (defined($level) ? $level : $linktest_level), "-e", "$pid/$eid"); $cmd .= " -t $timeout"
if (defined($timeout));
$cmd .= " -o $output"
if (defined($output));
$cmd .= " -l " . (defined($level) ? $level : $linktest_level);
$cmd .= " -s ops -e $pid/$eid";
print "Running '$cmd'\n"
if ($debug);
exec($cmd);
die("*** $0:\n". die("*** $0:\n".
" Could not exec run_linktest.pl\n"); " Could not exec run_linktest.pl\n");
...@@ -12,9 +12,7 @@ use POSIX; ...@@ -12,9 +12,7 @@ use POSIX;
# #
# Wrapper for running the linktest daemon. This script is currently # Wrapper for running the linktest daemon. This script is currently
# setup so it can run on either boss (or ops via plasticwrap), or from # setup so it can run on either ops or from an experimental node.
# an experimental node. Hence the odd paths and ltevent aux program,
# which is not really on boss. Also not use of tmcc to find the server.
# #
sub usage() sub usage()
{ {
...@@ -44,8 +42,7 @@ my $stopAt = 4 ; # default stop level ...@@ -44,8 +42,7 @@ my $stopAt = 4 ; # default stop level
my $TB = "@prefix@"; my $TB = "@prefix@";
my $TMCC = "@CLIENT_BINDIR@/tmcc"; my $TMCC = "@CLIENT_BINDIR@/tmcc";
my $LTEVENT = "@CLIENT_BINDIR@/ltevent"; my $LTEVENT = "@CLIENT_BINDIR@/ltevent";
my $LTEVENTBOSS = "$TB/libexec/ltevent"; my $LTEVENTOPS = "$TB/libexec/ltevent";
my $BOSSNODE = "@BOSSNODE@";
my $STOPEVENT = "STOP"; my $STOPEVENT = "STOP";
my $KILLEVENT = "KILL"; my $KILLEVENT = "KILL";
my $REPORTEVENT = "REPORT"; my $REPORTEVENT = "REPORT";
...@@ -182,24 +179,10 @@ else { ...@@ -182,24 +179,10 @@ else {
# #
# Need to figure out the elvind server. Since this script runs on boss # Default to the standard event server.
# and on experimental nodes, do something gross!
# #
if (!defined($server)) { if (!defined($server)) {
if (-x $TMCC) { $server = "@EVENTSERVER@";
my $results = `$TMCC bossinfo`;
if ($results =~ /^([\w\.]*)\s/) {
$server = $1;
}
else {
die("*** $0:\n".
" Bad data in server: $results\n");
}
}
else {
# We can do this on boss/ops, but not on experimental node.
$server = $BOSSNODE;
}
} }
# #
...@@ -352,6 +335,9 @@ sub analyze { ...@@ -352,6 +335,9 @@ sub analyze {
@dir_contents = grep(/\.fatal$|\.error$/, readdir(DIR)); @dir_contents = grep(/\.fatal$|\.error$/, readdir(DIR));
closedir(DIR); closedir(DIR);
unlink($logfile)
if (defined($logfile));
foreach my $file (@dir_contents) { foreach my $file (@dir_contents) {
# Hmm, need to taint check the filenames. Ick. # Hmm, need to taint check the filenames. Ick.
if ($file =~ /^([-\w\.\/]+)$/) { if ($file =~ /^([-\w\.\/]+)$/) {
...@@ -361,7 +347,7 @@ sub analyze { ...@@ -361,7 +347,7 @@ sub analyze {
die("*** $0:\n". die("*** $0:\n".
" Bad data in filename: $file\n"); " Bad data in filename: $file\n");
} }
if(defined($options{"o"})) { if (defined($logfile)) {
open LOG_FILE, ">>$logfile" || open LOG_FILE, ">>$logfile" ||
die "Could not open $logfile for append: $!"; die "Could not open $logfile for append: $!";
...@@ -383,8 +369,8 @@ sub analyze { ...@@ -383,8 +369,8 @@ sub analyze {
sub starter { sub starter {
my $cmd; my $cmd;
if (-x $LTEVENTBOSS) { if (-x $LTEVENTOPS) {
$cmd = $LTEVENTBOSS; $cmd = $LTEVENTOPS;
} }
else { else {
$cmd = $LTEVENT; $cmd = $LTEVENT;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group. # Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -10,6 +10,7 @@ global CLIENTVARDIR ...@@ -10,6 +10,7 @@ global CLIENTVARDIR
global CLIENTBINDIR global CLIENTBINDIR
set CLIENTVARDIR @CLIENT_VARDIR@ set CLIENTVARDIR @CLIENT_VARDIR@
set CLIENTBINDIR @CLIENT_BINDIR@ set CLIENTBINDIR @CLIENT_BINDIR@
set EVENTSERVER @EVENTSERVER@
# consults tmcc hostnames database to translate hostname to IP # consults tmcc hostnames database to translate hostname to IP
# returns ip address of name # returns ip address of name
...@@ -443,13 +444,13 @@ set eid [lindex $pideidlist 1] ...@@ -443,13 +444,13 @@ set eid [lindex $pideidlist 1]
set pid [lindex $pideidlist 2] set pid [lindex $pideidlist 2]
set logpath "/proj/$pid/exp/$eid/logs/nse-$vnode.log" set logpath "/proj/$pid/exp/$eid/logs/nse-$vnode.log"
set simobjname [$ns set tbname] set simobjname [$ns set tbname]
set nseswap_cmdline "$CLIENTBINDIR/tevc -s $boss -e $pid/$eid now $simobjname NSESWAP SIMHOST=$vnode" set nseswap_cmdline "$CLIENTBINDIR/tevc < -s $EVENTSERVER -e $pid/$eid now $simobjname NSESWAP SIMHOST=$vnode"
set pktrate_logpath "/proj/$pid/exp/$eid/logs/nse-vnodepktrate-$vnode.log" set pktrate_logpath "/proj/$pid/exp/$eid/logs/nse-vnodepktrate-$vnode.log"
# Configuring the Scheduler to monitor the event system # Configuring the Scheduler to monitor the event system
set evsink [new TbEventSink] set evsink [new TbEventSink]
$evsink event-server "elvin://$boss" $evsink event-server "elvin://$EVENTSERVER"
$evsink nseswap_cmdline $nseswap_cmdline $evsink nseswap_cmdline $nseswap_cmdline
$evsink logfile $logpath $evsink logfile $logpath
[$ns set scheduler_] tbevent-sink $evsink [$ns set scheduler_] tbevent-sink $evsink
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group. * Copyright (c) 2000-2004 University of Utah and the Flux Group.