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 434a472a authored by Leigh B. Stoller's avatar Leigh B. Stoller

* New libtmcc.pm module that encapsulates the tmcc interface. Most of the

  code that was in libsetup has moved into this library, and underwent a
  giant cleaning and pumping up. The interface from your typical perl
  script now looks like this:

  use libtmcc;

  if (tmcc(TMCCCMD_STATUS, "optional arguments", \@tmccresults) < 0) {
      warn("*** WARNING: Could not get status from server!\n");
      return -1;
  }
  foreach my $me (@tmccresults) {
	print "bite $me";
  }

  The arguments and results are optional values. There is a fourth optional
  value that is a hash of config options (basically converted to command
  line switches passed to tmcc). For example, to set the timeout on an
  individual call, pass a fourth argument like:

	("timeout" => 5)

  There is also a way to set global options so that all subsequent tmcc
  calls are affected:

	configtmcc("timeout", 5);

  I'll probably clean this up a bit to avoid the direct strings.

  The result list is a list of strings. Since we are trending away from
  using tmcc to transfer large amounts of data, I think this is okay.

* A new tmcc.pl which does little more than load libtmcc and use it.
  This will become the new tmcc, with the existing C version becoming a
  backend binary for it.

* All of the perl scripts in tmcd have been changed to use the new
  library. I left the few uses of tmcc in shell scripts alone since they
  were of the simple variety (mostly "state" command).

* And again, if you have read this far, you will learn why I bothered with
  all this. Well, the existing code was really bad and it was getting out
  of control. Sort of like a squid that was getting harder to control as
  its rotting tenticles slithered into more and more scripts. Anyway ...

  More important, my goal is to use the libtmcc library to add caching.  I
  have not worked out the details yet, but I am envisioning a configuration
  file, perhaps generated initially by tmcd, of all of the config
  values. If the library finds that file, it sucks the info out of the file
  instead of going to tmcd. Eventually, this config file would be generated
  as part of experiment swapping and stored in the DB, but thats a longer
  term project, and perhaps orthogonal (how we fill the cache is not as
  important as adding the ability to use a cache, right?).

  Note that certain operations (like "state" and "ready") are flagged by
  the library to always bypass the "cache".
parent fd279db8
stoller 2003/10/06 14:27:46 MDT
Modified files:
tmcd libsetup.pm
tmcd/common GNUmakefile.in bootsubnodes bootvnodes
ntpstart rc.progagent sendevent update
vnodesetup watchdog
tmcd/freebsd GNUmakefile.in delaysetup rc.delayagent
tbshutdown
tmcd/linux GNUmakefile.in delaysetup ixpboot
supfile.in
tmcd/plab GNUmakefile.in
tmcd/ron GNUmakefile.in emulabctl webserver.pl
Added files:
tmcd/common libtmcc.pm tmcc.pl
tmcd/ron makefile
Log:
* New libtmcc.pm module that encapsulates the tmcc interface. Most of the
code that was in libsetup has moved into this library, and underwent a
giant cleaning and pumping up. The interface from your typical perl
script now looks like this:
use libtmcc;
if (tmcc(TMCCCMD_STATUS, "optional arguments", \@tmccresults) < 0) {
warn("*** WARNING: Could not get status from server!\n");
return -1;
}
foreach my $me (@tmccresults) {
print "bite $me";
}
The arguments and results are optional values. There is a fourth optional
value that is a hash of config options (basically converted to command
line switches passed to tmcc). For example, to set the timeout on an
individual call, pass a fourth argument like:
("timeout" => 5)
There is also a way to set global options so that all subsequent tmcc
calls are affected:
configtmcc("timeout", 5);
I'll probably clean this up a bit to avoid the direct strings.
The result list is a list of strings. Since we are trending away from
using tmcc to transfer large amounts of data, I think this is okay.
* A new tmcc.pl which does little more than load libtmcc and use it.
This will become the new tmcc, with the existing C version becoming a
backend binary for it.
* All of the perl scripts in tmcd have been changed to use the new
library. I left the few uses of tmcc in shell scripts alone since they
were of the simple variety (mostly "state" command).
* And again, if you have read this far, you will learn why I bothered with
all this. Well, the existing code was really bad and it was getting out
of control. Sort of like a squid that was getting harder to control as
its rotting tenticles slithered into more and more scripts. Anyway ...
More important, my goal is to use the libtmcc library to add caching. I
have not worked out the details yet, but I am envisioning a configuration
file, perhaps generated initially by tmcd, of all of the config
values. If the library finds that file, it sucks the info out of the file
instead of going to tmcd. Eventually, this config file would be generated
as part of experiment swapping and stored in the DB, but thats a longer
term project, and perhaps orthogonal (how we fill the cache is not as
important as adding the ability to use a cache, right?).
Note that certain operations (like "state" and "ready") are flagged by
the library to always bypass the "cache".
Revision Changes Path
1.83 +322 -446 testbed/tmcd/libsetup.pm
1.14 +2 -0 testbed/tmcd/common/GNUmakefile.in
1.2 +14 -10 testbed/tmcd/common/bootsubnodes
1.10 +13 -9 testbed/tmcd/common/bootvnodes
1.4 +17 -13 testbed/tmcd/common/ntpstart
1.4 +2 -1 testbed/tmcd/common/rc.progagent
1.2 +4 -3 testbed/tmcd/common/sendevent
1.4 +1 -1 testbed/tmcd/common/update
1.18 +10 -7 testbed/tmcd/common/vnodesetup
1.8 +17 -11 testbed/tmcd/common/watchdog
1.40 +1 -1 testbed/tmcd/freebsd/GNUmakefile.in
1.10 +18 -13 testbed/tmcd/freebsd/delaysetup
1.7 +2 -1 testbed/tmcd/freebsd/rc.delayagent
1.3 +4 -2 testbed/tmcd/freebsd/tbshutdown
1.36 +1 -1 testbed/tmcd/linux/GNUmakefile.in
1.2 +12 -8 testbed/tmcd/linux/delaysetup
1.5 +23 -12 testbed/tmcd/linux/ixpboot
1.3 +1 -1 testbed/tmcd/linux/supfile.in
1.4 +5 -2 testbed/tmcd/plab/GNUmakefile.in
1.9 +1 -1 testbed/tmcd/ron/GNUmakefile.in
1.7 +4 -3 testbed/tmcd/ron/emulabctl
1.4 +49 -12 testbed/tmcd/ron/webserver.pl
stoller 2003/09/30 09:30:09 MDT
Modified files:
......
......@@ -64,6 +64,8 @@ path-install: dir-install
common-script-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/../libsetup.pm $(BINDIR)/libsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
$(INSTALL) -m 755 $(SRCDIR)/watchdog $(BINDIR)/watchdog
$(INSTALL) -m 755 $(SRCDIR)/ntpstart $(BINDIR)/ntpstart
$(INSTALL) -m 755 $(SRCDIR)/runstartup $(BINDIR)/runstartup
......
......@@ -36,6 +36,7 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# library and initialize itself.
#
use libsetup;
use libtmcc;
# Locals
my $logname = "$LOGDIR/bootsubnodes.debug";
......@@ -85,21 +86,24 @@ my %subnodelist;
# Get the current set of subnodes that are supposed to be running on
# this node.
#
my $TM = OPENTMCC(TMCCCMD_SUBNODELIST);
while (<$TM>) {
if ($_ =~ /^NODEID=([-\w]+) TYPE=([-\w]+)$/) {
my @tmccresults;
if (tmcc(TMCCCMD_SUBNODELIST, undef, \@tmccresults) < 0) {
die("*** WARNING: Could not get subnode list from server!\n");
}
if (! @tmccresults) {
print "No subnodes. Exiting gracefully ...\n";
exit(0);
}
foreach my $str (@tmccresults) {
if ($str =~ /^NODEID=([-\w]+) TYPE=([-\w]+)$/) {
$subnodelist{$1} = $2;
}
else {
print "Skipping bad subnodeid: '$_'\n";
warn("*** WARNING: Skipping bad subnodeid: '$str'\n");
}
}
CLOSETMCC($TM);
if (! scalar(keys(%subnodelist))) {
print "No subnodes. Exiting gracefully ...\n";
exit(0);
}
print "subnodelist is @{[keys(%subnodelist)]}\n";
# Pause to give hardware settle time.
......
......@@ -36,6 +36,7 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# library and initialize itself.
#
use libsetup;
use libtmcc;
# Locals
my $logname = "$LOGDIR/bootvnodes.debug";
......@@ -132,22 +133,25 @@ my @vnodes;
# Get the current set of vnodes that are supposed to be running on
# this node.
#
my $TM = OPENTMCC(TMCCCMD_VNODELIST);
while (<$TM>) {
my @tmccresults;
if (tmcc(TMCCCMD_VNODELIST, undef, \@tmccresults) < 0) {
die("*** WARNING: Could not get vnode list from server!\n");
}
if (! @tmccresults) {
print "No vnodes. Exiting gracefully ...\n";
exit(0);
}
foreach my $str (@tmccresults) {
if ($_ =~ /^VNODEID=([-\w]+) JAILED=(\d)$/) {
$curvnodelist{$1} = $2;
}
else {
print "Skipping bad vnodeid: '$_'\n";
warn("*** WARNING: Skipping bad subnodeid: '$str'\n");
}
}
CLOSETMCC($TM);
@vnodes = keys(%curvnodelist);
if (! @vnodes) {
print "No vnodes. Exiting gracefully ...\n";
exit(0);
}
print "Vnodelist is @vnodes.\n";
#
......
This diff is collapsed.
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
#
# TMCC library. Provides an interface to the TMCD via a config file
# or directly to it via TCP
#
# TODO: Proxy path in a jail.
#
package libtmcc;
use Exporter;
@ISA = "Exporter";
@EXPORT = qw(configtmcc tmcc tmccbossname
TMCCCMD_REBOOT TMCCCMD_STATUS TMCCCMD_STATE TMCCCMD_IFC
TMCCCMD_ACCT TMCCCMD_DELAY TMCCCMD_HOSTS TMCCCMD_RPM
TMCCCMD_TARBALL TMCCCMD_STARTUP TMCCCMD_DELTA TMCCCMD_STARTSTAT
TMCCCMD_READY TMCCCMD_MOUNTS TMCCCMD_ROUTING TMCCCMD_TRAFFIC
TMCCCMD_BOSSINFO TMCCCMD_TUNNEL TMCCCMD_NSECONFIGS
TMCCCMD_VNODELIST TMCCCMD_SUBNODELIST TMCCCMD_ISALIVE
TMCCCMD_SFSHOSTID TMCCCMD_SFSMOUNTS TMCCCMD_JAILCONFIG
TMCCCMD_PLABCONFIG TMCCCMD_SUBCONFIG TMCCCMD_LINKDELAYS
TMCCCMD_PROGRAMS TMCCCMD_SYNCSERVER TMCCCMD_KEYHASH TMCCCMD_NODEID
TMCCCMD_NTPINFO TMCCCMD_NTPDRIFT
);
# Must come after package declaration!
use English;
# Load up the paths. Done like this in case init code is needed.
BEGIN
{
if (! -e "/etc/emulab/paths.pm") {
die("Yikes! Could not require /etc/emulab/paths.pm!\n");
}
require "/etc/emulab/paths.pm";
import emulabpaths;
}
# The actual TMCC binary.
my $TMCCBIN = "$BINDIR/tmcc.bin";
my $PROXYDEF = "$BOOTDIR/proxypath";
my $debug = 0;
#
# Configuration. The importer of this library should set these values
# accordingly.
#
%config =
( "debug" => 0,
"useudp" => 0,
"beproxy" => 0, # A unix domain path when true.
"dounix" => 0, # A unix domain path when true.
"server" => undef,
"portnum" => undef,
"version" => undef,
"subnode" => undef,
"keyfile" => undef,
"timeout" => undef,
);
#
# List of TMCD commands. Some of these have to be passed through to
# tmcd, others can come from a local config file if it exists.
#
my %commandset =
( "reboot" => {TAG => "reboot", LOCAL => 0},
"status" => {TAG => "status", LOCAL => 0},
"state" => {TAG => "state", LOCAL => 0},
"ifconfig" => {TAG => "ifconfig", LOCAL => 1},
"accounts" => {TAG => "accounts", LOCAL => 1},
"delay" => {TAG => "delay", LOCAL => 1},
"hostnames" => {TAG => "hostnames", LOCAL => 1},
"rpms" => {TAG => "rpms", LOCAL => 1},
"tarballs" => {TAG => "tarballs", LOCAL => 1},
"startupcmd" => {TAG => "startupcmd", LOCAL => 1},
"deltas" => {TAG => "deltas", LOCAL => 1},
"startstatus" => {TAG => "startstatus", LOCAL => 0},
"ready" => {TAG => "ready", LOCAL => 0},
"mounts" => {TAG => "mounts", LOCAL => 1},
"routing" => {TAG => "routing", LOCAL => 1},
"trafgens" => {TAG => "trafgens", LOCAL => 1},
"bossinfo" => {TAG => "bossinfo", LOCAL => 0},
"tunnels" => {TAG => "tunnels", LOCAL => 1},
"nseconfigs" => {TAG => "nseconfigs", LOCAL => 1},
"vnodelist" => {TAG => "vnodelist", LOCAL => 1},
"subnodelist" => {TAG => "subnodelist", LOCAL => 1},
"isalive" => {TAG => "isalive", LOCAL => 0},
"sfshostid" => {TAG => "sfshostid", LOCAL => 0},
"sfsmounts" => {TAG => "sfsmounts", LOCAL => 1},
"jailconfig" => {TAG => "jailconfig", LOCAL => 1},
"plabconfig" => {TAG => "plabconfig", LOCAL => 1},
"subconfig" => {TAG => "subconfig", LOCAL => 1},
"linkdelays" => {TAG => "linkdelays", LOCAL => 1},
"programs" => {TAG => "programs", LOCAL => 1},
"syncserver" => {TAG => "syncserver", LOCAL => 1},
"keyhash" => {TAG => "keyhash", LOCAL => 1},
"nodeid" => {TAG => "nodeid", LOCAL => 1},
"ntpinfo" => {TAG => "ntpinfo", LOCAL => 1},
"ntprift" => {TAG => "ntpdrift.", LOCAL => 0},
);
#
# These are the TMCC commands for the user. They are exported above.
#
sub TMCCCMD_REBOOT() { $commandset{"reboot"}->{TAG}; }
sub TMCCCMD_STATUS() { $commandset{"status"}->{TAG}; }
sub TMCCCMD_STATE() { $commandset{"state"}->{TAG}; }
sub TMCCCMD_IFC() { $commandset{"ifconfig"}->{TAG}; }
sub TMCCCMD_ACCT() { $commandset{"accounts"}->{TAG}; }
sub TMCCCMD_DELAY() { $commandset{"delay"}->{TAG}; }
sub TMCCCMD_HOSTS() { $commandset{"hostnames"}->{TAG}; }
sub TMCCCMD_RPM() { $commandset{"rpms"}->{TAG}; }
sub TMCCCMD_TARBALL() { $commandset{"tarballs"}->{TAG}; }
sub TMCCCMD_STARTUP() { $commandset{"startupcmd"}->{TAG}; }
sub TMCCCMD_DELTA() { $commandset{"deltas"}->{TAG}; }
sub TMCCCMD_STARTSTAT() { $commandset{"startstatus"}->{TAG}; }
sub TMCCCMD_READY() { $commandset{"ready"}->{TAG}; }
sub TMCCCMD_MOUNTS() { $commandset{"mounts"}->{TAG}; }
sub TMCCCMD_ROUTING() { $commandset{"routing"}->{TAG}; }
sub TMCCCMD_TRAFFIC() { $commandset{"trafgens"}->{TAG}; }
sub TMCCCMD_BOSSINFO() { $commandset{"bossinfo"}->{TAG}; }
sub TMCCCMD_TUNNEL() { $commandset{"tunnels"}->{TAG}; }
sub TMCCCMD_NSECONFIGS(){ $commandset{"nseconfigs"}->{TAG}; }
sub TMCCCMD_VNODELIST() { $commandset{"vnodelist"}->{TAG}; }
sub TMCCCMD_SUBNODELIST(){ $commandset{"subnodelist"}->{TAG}; }
sub TMCCCMD_ISALIVE() { $commandset{"isalive"}->{TAG}; }
sub TMCCCMD_SFSHOSTID() { $commandset{"sfshostid"}->{TAG}; }
sub TMCCCMD_SFSMOUNTS() { $commandset{"sfsmounts"}->{TAG}; }
sub TMCCCMD_JAILCONFIG(){ $commandset{"jailconfig"}->{TAG}; }
sub TMCCCMD_PLABCONFIG(){ $commandset{"plabconfig"}->{TAG}; }
sub TMCCCMD_SUBCONFIG() { $commandset{"subconfig"}->{TAG}; }
sub TMCCCMD_LINKDELAYS(){ $commandset{"linkdelays"}->{TAG}; }
sub TMCCCMD_PROGRAMS() { $commandset{"programs"}->{TAG}; }
sub TMCCCMD_SYNCSERVER(){ $commandset{"syncserver"}->{TAG}; }
sub TMCCCMD_KEYHASH() { $commandset{"keyhash"}->{TAG}; }
sub TMCCCMD_NODEID() { $commandset{"nodeid"}->{TAG}; }
sub TMCCCMD_NTPINFO() { $commandset{"ntpinfo"}->{TAG}; }
sub TMCCCMD_NTPDRIFT() { $commandset{"ntpdrift"}->{TAG}; }
#
# Caller uses this routine to set configuration of this library
#
sub configtmcc($$)
{
my ($opt, $val) = @_;
if (!exists($config{$opt})) {
print STDERR "*** $0:\n".
" Invalid libtmcc option: $opt/$val\n";
return -1;
}
$config{$opt} = $val;
}
#
# Convert the config hash to an option string. This is separate so that
# the user can provide their own option hash on a single tmcc call, which
# *augments* the global options. First argument is a string to augment.
# Returns the augmented string.
#
sub optionstring($%)
{
my ($options, %opthash) = @_;
if ($opthash{"debug"}) {
$options .= " -d";
$debug = 1;
}
if ($opthash{"useudp"}) {
$options .= " -u";
}
if ($opthash{"beproxy"}) {
$options .= " -x " . $opthash{"beproxy"};
}
if ($opthash{"dounix"}) {
$options .= " -l " . $opthash{"dounix"};
}
if (defined($opthash{"server"})) {
$options .= " -s " . $opthash{"server"};
}
if (defined($opthash{"portnum"})) {
$options .= " -p " . $opthash{"portnum"};
}
if (defined($opthash{"version"})) {
$options .= " -v " . $opthash{"version"};
}
if (defined($opthash{"keyfile"})) {
$options .= " -k " . $opthash{"keyfile"};
}
if (defined($opthash{"timeout"})) {
$options .= " -t " . $opthash{"timeout"};
}
return $options;
}
#
# Run the external tmcc program with the proper arguments.
#
# usage: tmcc(char *command, char *arguments, list \$results, hash %options)
# returns -1 if tmcc fails for any reason.
# returns 0 if tmcc succeeds.
#
# If a "results" argument (pass by reference) has been provided, then
# take the results of tmcc, and store a list of strings into it.
# If an options hash is passed, use that to extend the global config options.
#
sub runtmcc ($;$$%)
{
my ($cmd, $args, $results, %optconfig) = @_;
my @strings = ();
my $options;
$options = optionstring("", %config);
$options = optionstring($options, %optconfig)
if (%optconfig);
if (!defined($args)) {
$args = "";
}
my $string = "$TMCCBIN $options $cmd $args";
if ($debug) {
print STDERR "$string\n";
}
if (!open(TM, "$string |")) {
print STDERR "Cannot start TMCC: $!\n";
return -1;
}
while (<TM>) {
push(@strings, $_);
}
if (! close(TM)) {
if ($?) {
print STDERR "TMCC exited with status $?!\n";
}
else {
print STDERR "Error closing TMCC pipe: $!\n";
}
return -1;
}
@$results = @strings
if (defined($results));
return 0;
}
#
# Standard entrypoint that is intended to behave just like the
# external program. Return -1 on failure, 0 on success.
#
sub tmcc ($;$$%)
{
my ($cmd, $args, $results, %opthash) = @_;
#
# Check for proxypath file, but do not override config option.
#
if (!$config{"dounix"} && -e $PROXYDEF) {
#
# Suck out the path and untaint.
#
open(PP, "$BOOTDIR/proxypath");
my $ppath = <PP>;
close(PP);
if ($ppath =~ /^([-\w\.\/]+)$/) {
$config{"dounix"} = $ppath;
}
else {
die("Bad data in tmccproxy path: $ppath");
}
}
return(runtmcc($cmd, $args, $results, %opthash));
}
#
# This is done very often! It should always work since we figure it out
# locally, so return the info directly.
#
sub tmccbossname()
{
my @tmccresults;
if (runtmcc(TMCCCMD_BOSSINFO, undef, \@tmccresults) < 0 ||
!scalar(@tmccresults)) {
warn("*** WARNING: Could not get bossinfo from tmcc!\n");
return undef;
}
my ($bossname) = split(" ", $tmccresults[0]);
#
# Taint check. Nice to do for the caller. Also strips any newline.
#
if ($bossname =~ /^([-\w\.]*)$/) {
$bossname = $1;
}
else {
warn("*** WARNING: Tainted bossname from tmcc: $bossname\n");
return undef;
}
return $bossname;
}
1;
......@@ -38,6 +38,7 @@ $| = 1;
# library and initialize itself.
#
use libsetup;
use libtmcc;
# Locals
my @ntpinfo = ();
......@@ -48,6 +49,7 @@ my $driftfile = "/etc/ntp.drift";
my $pidfile = "/var/run/ntpd.pid";
my $ntpdate = "/usr/sbin/ntpdate";
my $debug = 0;
my @tmccresults;
#
# Since this is a wrapper, we have to try to start ntp no matter what.
......@@ -69,8 +71,8 @@ sub ntpdate() {
# We need to give -b to set time directly (instead of using adjtime()), and
# give the boss node's name
#
my ($bossname) = split(" ", `tmcc bossinfo`);
my $ntpcmd = "$ntpdate -b -s ";
my $bossname = tmccbossname();
my $ntpcmd = "$ntpdate -b -s ";
if (REMOTE()) {
$ntpcmd .= "-t 5 ";
}
......@@ -97,23 +99,25 @@ if (ntpdate()) {
# but no servers/peers, then need to leave the config alone and just
# replace the drift file.
#
my $args = "";
if (REMOTE()) {
$args .= "-t 5";
# Do not allow blocking on the network.
configtmcc("timeout", 5);
}
open(TM, "tmcc $args ntpinfo |")
or fatal("Could not start tmcc: $!");
while (<TM>) {
chomp();
if ($_ =~ /^PEER=.*$/ ||
$_ =~ /^SERVER=.*$/) {
if (tmcc(TMCCCMD_NTPINFO, undef, \@tmccresults) < 0) {
warn("*** $0:\n".
" Failed to get ntpinfo from server! Falling back ...\n");
exit(ntpstart());
}
foreach my $str (@tmccresults) {
chomp($str);
if ($str =~ /^PEER=.*$/ ||
$str =~ /^SERVER=.*$/) {
$useold = 0;
}
push(@ntpinfo, $_);
push(@ntpinfo, $str);
}
close(TM)
or fatal("tmcc error!");
if (! @ntpinfo) {
exit(ntpstart());
}
......
......@@ -28,6 +28,7 @@ sub fatal($);
# library and initialize itself.
#
use libsetup;
use libtmcc;
#
# Parse command arguments. Once we return from getopts, all that should be
......@@ -70,7 +71,7 @@ if ($OSNAME eq "freebsd") {
$bossname = "localhost";
}
else {
($bossname) = split(" ", `tmcc bossinfo`);
$bossname = tmccbossname();
}
#
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -19,8 +19,9 @@ BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
# We use the tmcc to figure out where the Testbed Event Daemon is running.
# Don't worry about the port for now.
#
my ($bossname) = split(" ", `tmcc bossinfo`);
unshift(@ARGV, ("-s", "$bossname"));
use libtmcc;
unshift(@ARGV, ("-s", tmccbossname()));
exec "tevc", @ARGV;
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use Getopt::Std;
#
# Perl wrapper to TMCC. Everything is done in the library.
#
# The library parses the options.
sub usage()
{
print STDERR "usage: tmcc [options] <command> [arg1 ...]\n";
print STDERR " -d Turn on debugging\n";
print STDERR " -s server Specify a tmcd server to connect to\n";
print STDERR " -p portnum Specify a port number to connect to\n";
print STDERR " -v versnum Specify a version number for tmcd\n";
print STDERR " -n subnode Specify the subnode id\n";
print STDERR " -k keyfile Specify the private keyfile\n";
print STDERR " -u Use UDP instead of TCP\n";
print STDERR " -l path Use named unix domain socket instead of TCP\n";
print STDERR " -t timeout Timeout waiting for the controller.\n";
print STDERR " -x path Be a proxy using the unix domain socket\n";
exit