Skip to content
GitLab
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
b600feaf
Commit
b600feaf
authored
Jan 16, 2001
by
Leigh B. Stoller
Browse files
A bunch of changes to the output of these scripts to make it more
web output friendly. Less is more.
parent
281b8bc2
Changes
8
Hide whitespace changes
Inline
Side-by-side
db/nalloc.in
View file @
b600feaf
...
...
@@ -81,12 +81,9 @@ $sth = $dbh->query($cmd)
if
(
!
$error
&&
@nodes
)
{
foreach
$n
(
@nodes
)
{
print
"
Setting up console for
$n
...
\n
";
system
("
$consetup
$n
")
==
0
or
print
STDERR
"
WARNING:
$consetup
$n
failed!
\n
";
}
}
print
"
Done.
\n
";
exit
(
$error
);
db/nfree.in
View file @
b600feaf
...
...
@@ -158,11 +158,8 @@ if ( %reloads > 0 ) {
}
foreach
$n
(
@freed_nodes
)
{
print
"
Resetting console for
$n
...
\n
";
system
("
$consetup
$n
")
==
0
or
print
STDERR
"
WARNING:
$consetup
$n
failed!
\n
";
}
print
"
Done.
\n
";
exit
(
$error
);
tbsetup/ir/assign_wrapper.in
View file @
b600feaf
...
...
@@ -332,8 +332,8 @@ sub getmac {
}
};
print
"
Running assign (
$assign
-b -t
$ptopfile
$topfile
)
\n
";
print
"
Log in assign.log
\n
";
#
print "Running assign ($assign -b -t $ptopfile $topfile)\n";
#
print " Log in assign.log\n";
$run
=
1
;
while
(
$run
<=
$maxrun
)
{
printdb
"
run
$run
\n
";
...
...
tbsetup/libtbsetup.pm
View file @
b600feaf
...
...
@@ -20,6 +20,9 @@ sub tbs_initdbi {
sub
tbs_initlog
{
my
(
$logfile
)
=
$_
[
0
];
# Turn off line buffering.
$|
=
1
;
open
(
LOGFILE
,"
>
$logfile
")
||
do
{
print
STDERR
"
Could not open
$logfile
for writing.
\n
";
exit
(
1
);
...
...
tbsetup/tbdoit.in
View file @
b600feaf
...
...
@@ -100,14 +100,15 @@ if (system("/bin/cp", "$tempfile", "$nsfile") != 0) {
#
# Run the various scripts.
#
print
STDOUT
"
Running
$tbdir
/tbprerun with arguments:
$project
$eid
$nsfile
\n
";
#print STDOUT "Running $tbdir/tbprerun with arguments: ".
# "$project $eid $nsfile\n";
if
(
system
("
$tbdir
/tbprerun
$project
$eid
$nsfile
")
!=
0
)
{
print
STDOUT
"
tbprerun failed!
\n
";
dumplog
();
fatal
();
}
print
STDOUT
"
Running
$tbdir
/tbrun with arguments:
$project
$eid
$irfile
\n
";
#
print STDOUT "Running $tbdir/tbrun with arguments: $project $eid $irfile\n";
if
(
system
("
$tbdir
/tbrun
$project
$eid
$irfile
")
!=
0
)
{
print
STDOUT
"
tbrun failed!
\n
";
dumplog
();
...
...
@@ -115,7 +116,8 @@ if (system("$tbdir/tbrun $project $eid $irfile") != 0) {
fatal
();
}
print
STDOUT
"
Running tbreport with arguments: -v
$project
$eid
$irfile
2>&1 >
$repfile
\n
";
#print STDOUT "Running tbreport with arguments: ".
# "-v $project $eid $irfile 2>&1 > $repfile\n";
if
(
system
("
$tbdir
/tbreport -v
$project
$eid
$irfile
2>&1 >
$repfile
")
!=
0
)
{
print
STDOUT
"
tbreport failed!
\n
";
dumplog
();
...
...
tbsetup/tbprerun.in
View file @
b600feaf
...
...
@@ -70,7 +70,7 @@ if (! -r $irfile) {
exit
(
1
);
}
&tbs_out
("
Post parsing NS input.
");
#
&tbs_out("Post parsing NS input.");
if
(
&tbs_exec
("
postparse
$nsfile
$irfile
"))
{
&tbs_out
("
Postparsing failed.
\n
");
exit
(
1
);
...
...
@@ -126,14 +126,14 @@ while ($done == 0) {
}
}
&tbs_out
("
Syncing database with assignment.
\n
");
#
&tbs_out("Syncing database with assignment.\n");
if
(
&tbs_exec
("
postassign
$irfile
"))
{
&tbs_out
("
Error syncing.
\n
");
&cleanup
();
exit
(
1
);
}
&tbs_out
("
!!! Any further errors will result in partial DB state.
\n
");
#
&tbs_out("!!! Any further errors will result in partial DB state.\n");
&tbs_out
("
Allocating IP addresses.
\n
");
if
(
&tbs_exec
("
handle_ip
$irfile
$nsfile
"))
{
...
...
tbsetup/tbrun.in
View file @
b600feaf
...
...
@@ -28,9 +28,9 @@ $logfile = "$prefix.log";
&tbs_initlog
(
$logfile
);
&tbs_out
("
Input:
$irfile
\n
");
&tbs_out
("
Log:
$logfile
\n
");
&tbs_out
("
\n
");
#
&tbs_out("Input: $irfile\n");
#
&tbs_out("Log: $logfile\n");
#
&tbs_out("\n");
if
(
!
-
r
$irfile
)
{
&tbs_out
("
$irfile
does not exist or is not readable.
\n
");
...
...
www/beginexp_process.php3
View file @
b600feaf
...
...
@@ -233,29 +233,23 @@ if (($pipe = popen("$TBSUEXEC_PATH $uid $gid ".
}
$count
=
0
;
echo
"<XMP>
\n
"
;
while
(
!
feof
(
$pipe
))
{
$line
=
fgets
(
$pipe
,
1024
);
$output
[
$count
]
=
$line
;
$count
++
;
if
(((
$now
=
time
())
-
$last
)
>=
5
)
{
$last
=
$now
;
echo
"Thinking ...
\n
<br>"
;
flush
();
}
echo
"
$line
"
;
flush
();
}
echo
"</XMP>
\n
"
;
$retval
=
pclose
(
$pipe
);
if
(
$retval
)
{
echo
"<br><br><h2>
Setup Failure(
$retval
): Output as follows:
</h2>
<br>
<XMP>
\n
"
;
for
(
$i
=
0
;
$i
<
count
(
$output
);
$i
++
)
{
echo
"
$output[$i]
"
;
}
echo
"</XMP>
\n
"
;
echo
"<center><br><br><h2>
Setup Failure(
$retval
)
</h2><br></center>
\n
"
;
$query_result
=
mysql_db_query
(
$TBDBNAME
,
"DELETE FROM experiments WHERE eid='
$exp_id
' and pid=
\"
$exp_pid
\"
"
);
...
...
@@ -263,22 +257,11 @@ if ($retval) {
die
(
""
);
}
#
# Debugging!
#
if
(
$mydebug
)
{
echo
"<XMP>
\n
"
;
for
(
$i
=
0
;
$i
<
count
(
$output
);
$i
++
)
{
echo
"
$output[$i]
"
;
}
echo
"</XMP>
\n
"
;
}
echo
"<center><br>"
;
echo
"<h2>Experiment Configured!<br>"
;
echo
"The ID for your experiment in project
$exp_pid
is
$exp_id
<br>"
;
echo
"
Here is a summary of the nodes that were allocated
<br>"
;
echo
"
</h2></center><br>
"
;
echo
"
For your convenience, we have created a directory hierarchy on the
<br>"
;
echo
"
control node:
$dirname
\n
"
;
#
# The tbdoit script dumps report output to stdout. Look for it in the
...
...
@@ -290,12 +273,9 @@ for ($i = 0; $i < count($output); $i++) {
break
;
}
$summary
=
""
;
echo
"<XMP>
\n
"
;
for
(
$i
=
$i
+
1
;
$i
<
count
(
$output
);
$i
++
)
{
$summary
=
"
$summary
$output[$i]
"
;
echo
"
$output[$i]
"
;
}
echo
"</XMP>
\n
"
;
#
# Lets generate a mail message for now so that we can see whats happening.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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