Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
15e0473a
Commit
15e0473a
authored
Nov 03, 2005
by
Russ Fish
Browse files
Add backup to get ltmap via tmcc instead of NFS, like topomap.
parent
1b49a9ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/common/config/rc.topomap
View file @
15e0473a
...
...
@@ -175,6 +175,19 @@ sub dotopomap()
}
}
if
(
!
-
e
$templt
)
{
#
# Try using tmcc. It returns compressed data so do it directly.
#
system
(
TMCC
()
.
"
ltmap >
$templt
");
#
# tmcc does not really return useful error codes.
#
if
(
$?
)
{
fatal
("
Could not get ltmap from tmcd or from NFS
");
}
}
if
(
-
s $tempmap) {
system("cat ${tempmap} | gunzip > " . TMTOPOMAP());
if ($
?)
{
...
...
tmcd/tmcd.c
View file @
15e0473a
...
...
@@ -239,6 +239,7 @@ COMMAND_PROTOTYPE(douserenv);
COMMAND_PROTOTYPE
(
dotiptunnels
);
COMMAND_PROTOTYPE
(
dorelayconfig
);
COMMAND_PROTOTYPE
(
dotraceconfig
);
COMMAND_PROTOTYPE
(
doltmap
);
/*
* The fullconfig slot determines what routines get called when pushing
...
...
@@ -323,7 +324,7 @@ struct command {
{
"userenv"
,
FULLCONFIG_ALL
,
F_ALLOCATED
,
douserenv
},
{
"tiptunnels"
,
FULLCONFIG_ALL
,
F_ALLOCATED
,
dotiptunnels
},
{
"traceinfo"
,
FULLCONFIG_ALL
,
F_ALLOCATED
,
dotraceconfig
},
{
"ltmap"
,
FULLCONFIG_NONE
,
F_MINLOG
|
F_ALLOCATED
,
doltmap
},
};
static
int
numcommands
=
sizeof
(
command_array
)
/
sizeof
(
struct
command
);
...
...
@@ -5900,6 +5901,43 @@ COMMAND_PROTOTYPE(dotopomap)
return
0
;
}
/*
* Spit back the ltmap. This is a backup for when NFS fails.
* We send back the gzipped version.
*/
COMMAND_PROTOTYPE
(
doltmap
)
{
FILE
*
fp
;
char
buf
[
MYBUFSIZE
];
int
cc
;
/*
* Open up the file on boss and spit it back.
*/
sprintf
(
buf
,
"%s/expwork/%s/%s/ltmap.gz"
,
TBROOT
,
reqp
->
pid
,
reqp
->
eid
);
if
((
fp
=
fopen
(
buf
,
"r"
))
==
NULL
)
{
errorc
(
"DOLTMAP: Could not open ltmap for %s:"
,
reqp
->
nodeid
);
return
1
;
}
while
(
1
)
{
cc
=
fread
(
buf
,
sizeof
(
char
),
sizeof
(
buf
),
fp
);
if
(
cc
==
0
)
{
if
(
ferror
(
fp
))
{
fclose
(
fp
);
return
1
;
}
break
;
}
client_writeback
(
sock
,
buf
,
cc
,
tcp
);
}
fclose
(
fp
);
return
0
;
}
/*
* Return user environment.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment