Commit ddc5f5a7 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add "creator" goo (to libtmcc, rc.misc).

Add "emulabconfig" goo to libtmcc.
parent 43de2407
......@@ -85,6 +85,7 @@ exit(0);
# More protos
sub donodeid();
sub docreator();
#
# Boot Action.
......@@ -94,6 +95,7 @@ sub doboot()
# Handled elsewhere for other node types.
donodeid()
if (!PLAB() && !JAILED() && !IXP());
docreator();
}
#
......@@ -118,7 +120,7 @@ sub doreconfig()
#
sub docleanup()
{
unlink TMNODEID();
unlink TMNODEID(), TMCREATOR();
}
#
......@@ -149,3 +151,31 @@ sub donodeid()
return 0;
}
#
# Get experiment creator
#
sub docreator()
{
my $creator;
my @tmccresults;
if (tmcc(TMCCCMD_CREATOR, undef, \@tmccresults) < 0) {
fatal("Could not get creator from server!");
}
return 0
if (! @tmccresults);
#
# There should be just one string. Ignore anything else.
#
if ($tmccresults[0] =~ /^CREATOR=([-\w]*)$/) {
$creator = $1;
}
else {
fatal("Bad creator line: $tmccresults[0]");
}
system("echo '$creator' > ". TMCREATOR());
return 0;
}
......@@ -29,7 +29,7 @@ use Exporter;
CONFDIR TMDELAY TMJAILNAME TMSIMRC TMCC
TMNICKNAME TMSTARTUPCMD FINDIF
TMROUTECONFIG TMLINKDELAY TMDELMAP TMTOPOMAP
TMGATEDCONFIG TMSYNCSERVER TMKEYHASH TMNODEID TMEVENTKEY
TMGATEDCONFIG TMSYNCSERVER TMKEYHASH TMNODEID TMEVENTKEY TMCREATOR
);
# Must come after package declaration!
......@@ -215,6 +215,7 @@ sub TMEVENTKEY() { CONFDIR() . "/eventkey";}
sub TMNODEID() { CONFDIR() . "/nodeid";}
sub TMROLE() { CONFDIR() . "/role";}
sub TMSIMRC() { CONFDIR() . "/rc.simulator";}
sub TMCREATOR() { CONFDIR() . "/creator";}
#
# This is a debugging thing for my home network.
......
......@@ -27,7 +27,8 @@ use Exporter;
TMCCCMD_PROGRAMS TMCCCMD_SYNCSERVER TMCCCMD_KEYHASH TMCCCMD_NODEID
TMCCCMD_NTPINFO TMCCCMD_NTPDRIFT TMCCCMD_EVENTKEY TMCCCMD_ROUTELIST
TMCCCMD_ROLE TMCCCMD_RUSAGE TMCCCMD_WATCHDOGINFO TMCCCMD_HOSTKEYS
TMCCCMD_FIREWALLINFO
TMCCCMD_FIREWALLINFO TMCCCMD_EMULABCONFIG
TMCCCMD_CREATOR
);
# Must come after package declaration!
......@@ -155,6 +156,8 @@ my %commandset =
"watchdoginfo" => {TAG => "watchdoginfo"},
"hostkeys" => {TAG => "hostkeys"},
"firewallinfo" => {TAG => "firewallinfo"},
"emulabconfig" => {TAG => "emulabconfig"},
"creator" => {TAG => "creator"},
);
#
......@@ -199,6 +202,8 @@ sub TMCCCMD_RUSAGE() { $commandset{"rusage"}->{TAG}; }
sub TMCCCMD_WATCHDOGINFO(){ $commandset{"watchdoginfo"}->{TAG}; }
sub TMCCCMD_HOSTKEYS() { $commandset{"hostkeys"}->{TAG}; }
sub TMCCCMD_FIREWALLINFO(){ $commandset{"firewallinfo"}->{TAG}; }
sub TMCCCMD_EMULABCONFIG(){ $commandset{"emulabconfig"}->{TAG}; }
sub TMCCCMD_CREATOR (){ $commandset{"creator"}->{TAG}; }
#
# Caller uses this routine to set configuration of this library
......
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