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

Copy over topomap from NFS experiment data and place in /var/emulab/boot.

See initial revision for tbsetup/gentopfile for more details. Note
that a gzipped version of the file is also created by gentopofile, and
we try to get that first to cut down on the amount of data copied over
(the topomap is highly compressable).
parent 0cb4df19
......@@ -85,6 +85,7 @@ exit(0);
# More protos
sub donodeid();
sub dotopomap();
#
# Boot Action.
......@@ -93,7 +94,10 @@ sub doboot()
{
# Handled elsewhere for other node types.
donodeid()
if (!PLAB() && !JAILED() && !IXP())
if (!PLAB() && !JAILED() && !IXP());
dotopomap()
if (!PLAB() && !JAILED() && !IXP());
}
#
......@@ -119,6 +123,7 @@ sub doreconfig()
sub docleanup()
{
unlink TMNODEID();
unlink TMTOPOMAP();
}
#
......@@ -148,3 +153,25 @@ sub donodeid()
system("echo '$nodeid' > ". TMNODEID);
return 0;
}
#
# Get topomap
#
sub dotopomap()
{
my ($pid, $eid, $vname) = check_nickname();
#
# Copy over the topomap so that it is locally resident. We will eventually
# get this via a tarfile instead of NFS.
#
my $topomap = "/proj/$pid/exp/$eid/tbdata/topomap";
if (-e "${topomap}.gz") {
system("cat ${topomap}.gz | gunzip > " . TMTOPOMAP());
}
elsif (-e $topomap) {
system("cp -fp $topomap ". TMTOPOMAP());
}
}
......@@ -16,7 +16,7 @@ use Fcntl ':flock';
# Drag in path stuff so we can find emulab stuff. Also untaints path.
BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
use libsetup qw(REMOTE LOCALROOTFS TBDebugTimeStamp);
use libsetup qw(REMOTE LOCALROOTFS TMTOPOMAP TBDebugTimeStamp);
use libtmcc;
#
......@@ -325,9 +325,26 @@ TBDebugTimeStamp("mkjail tmcc proxy is running");
#
$jailpid = fork();
if ($jailpid) {
# We do not really care about the exit status of the jail.
waitpid($jailpid, 0);
undef($jailpid);
#
# We do not really care about the exit status of the jail. We want to catch
# any children, which includes the tmcc proxy. If it dies, something has
# gone wrong, and that appears to happen a lot. Lets restart it until we
# figure out what is going wrong.
#
while (1) {
my $kidpid = waitpid(-1, 0);
if ($kidpid == $jailpid) {
undef($jailpid);
last;
}
if ($kidpid == $tmccpid) {
print("TMCC proxy exited with status $?. Restarting ...\n");
startproxy("$JAILPATH/$vnodeid");
next;
}
print("Unknown child $kidpid exited with status $?!\n");
}
}
else {
$SIG{TERM} = 'DEFAULT';
......@@ -519,6 +536,9 @@ sub mkrootfs($)
TBDebugTimeStamp("mkjail copying the tmcc cache");
tmcccopycache($vnodeid, "$path/root");
if (-e TMTOPOMAP()) {
mysystem("cp -fp " . TMTOPOMAP() . " $path/root/var/emulab/boot");
}
#
# Stash the control net IP if not the same as the host IP
......@@ -685,6 +705,9 @@ sub restorerootfs($)
}
tmcccopycache($vnodeid, "$path/root");
if (-e TMTOPOMAP()) {
mysystem("cp -fp " . TMTOPOMAP() . " $path/root/var/emulab/boot");
}
#
# The proc FS in the jail is per-jail of course.
......@@ -780,6 +803,7 @@ sub startproxy($)
{
my ($dir) = @_;
my $log = "$dir/tmcc.log";
my $klog = "$dir/tmcc.ktrace";
#
# The point of these paths is so that there is a comman path to
......@@ -810,7 +834,7 @@ sub startproxy($)
# The -o option will cause the proxy to detach but not fork!
# Eventually change this to standard pid file kill.
exec("$TMCC -d -x $outsidepath -n $vnodeid -o $log");
exec("ktrace -i -a -f $klog $TMCC -d -x $outsidepath -n $vnodeid -o $log");
die("Exec of $TMCC failed! $!\n");
}
......
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