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-stable
Commits
3f1067d5
Commit
3f1067d5
authored
Mar 05, 2005
by
Leigh B. Stoller
Browse files
Fall back to using tmcd to get topomap if NFS fails.
parent
956943a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/common/config/rc.topomap
View file @
3f1067d5
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004
, 2005
University of Utah and the Flux Group.
# All rights reserved.
#
use
English
;
...
...
@@ -139,17 +139,35 @@ sub dotopomap()
# Try a couple of times to get the file cause of NFS sillyness.
# Should probably have our own version of cp that retries at the block
# level?
#
for
(
my
$i
=
0
;
$i
<
5
;
$i
++
)
{
last
if
(
system
("
cp -fp
$topomap
$tempmap
")
==
0
);
unlink
("
$tempmap
");
#
if
(
!
(
USESFS
()
||
WINDOWS
()))
{
for
(
my
$i
=
0
;
$i
<
5
;
$i
++
)
{
last
if
(
system
("
cp -fp
$topomap
$tempmap
")
==
0
);
unlink
("
$tempmap
");
}
}
if
(
-
e
$
{
tempmap
})
{
if
(
!
-
e
$tempmap
)
{
#
# Try using tmcc. It returns compressed data so do it directly.
#
system
(
TMCC
()
.
"
topomap >
$tempmap
");
#
# tmcc does not really return useful error codes.
#
if
(
$?
)
{
fatal
("
Could not get topomap from tmcd or from NFS
");
}
}
if
(
-
s $tempmap) {
system("cat ${tempmap} | gunzip > " . TMTOPOMAP());
if ($
?)
{
fatal
("
Could not unzip topomap
");
}
}
else
{
fatal
("
Could not
copy over
$
topomap
");
fatal
("
Could not
get
topomap
");
}
}
Write
Preview
Markdown
is supported
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