Commit 65b00718 authored by Kevin Atkinson's avatar Kevin Atkinson
Browse files

Fixes from mike, to better format the output of rc.blobs.

This including redirecting Frisbee output to a logfile.
parent 086192ef
...@@ -98,9 +98,9 @@ sub doboot() ...@@ -98,9 +98,9 @@ sub doboot()
my $errors = 0; my $errors = 0;
my $need_mkextrafs = 1; my $need_mkextrafs = 1;
if (-e "/var/emulab/boot/rc.blobs-ran") { if (-e "$BOOTDIR/rc.blobs-ran") {
print STDOUT "Blobs installation already ran on this node.\n"; print STDOUT " Blobs installation already done.\n";
print STDOUT " Remove /var/emulab/boot/rc.blobs-ran to run again.\n"; print STDOUT " (Remove $BOOTDIR/rc.blobs-ran to run again.)\n";
exit 0; exit 0;
} }
...@@ -112,6 +112,7 @@ sub doboot() ...@@ -112,6 +112,7 @@ sub doboot()
return return
if (! @blobs); if (! @blobs);
unlink("$LOGDIR/blobs.log");
foreach my $blob (@blobs) { foreach my $blob (@blobs) {
eval { eval {
($mcastaddr, $portnum, undef, $basename, $dest) = ($mcastaddr, $portnum, undef, $basename, $dest) =
...@@ -120,14 +121,15 @@ sub doboot() ...@@ -120,14 +121,15 @@ sub doboot()
# FIXME: Make sure $basename doesn't exist... # FIXME: Make sure $basename doesn't exist...
my $local_path = "/var/tmp/$basename"; my $local_path = "/var/tmp/$basename";
my $frisbee_cmd = "$FRISBEE -p $portnum -m $mcastaddr $local_path"; my $frisbee_cmd = "$FRISBEE -p $portnum -m $mcastaddr $local_path".
" >>$LOGDIR/blobs.log 2>&1";
if ($dest =~ /^\/local/ && $need_mkextrafs) { if ($dest =~ /^\/local/ && $need_mkextrafs) {
os_mountextrafs("/local"); os_mountextrafs("/local");
$need_mkextrafs = 0; $need_mkextrafs = 0;
} }
print STDOUT "Fetching blob $basename to $local_path and unpacking to $dest\n"; print STDOUT " Downloading blob $basename to $local_path\n";
#print STDOUT "$frisbee_cmd\n"; #print STDOUT "$frisbee_cmd\n";
# launch frisbee # launch frisbee
...@@ -135,11 +137,13 @@ sub doboot() ...@@ -135,11 +137,13 @@ sub doboot()
die "Frisbee failed\n"; die "Frisbee failed\n";
} }
my $unpack_cmd = "$TARINSTALL -f $dest $local_path"; print STDOUT " Unpacking to $dest\n";
my $unpack_cmd = "$TARINSTALL -f $dest $local_path".
" >>$LOGDIR/blobs.log 2>&1";
#print STDOUT "$unpack_cmd\n"; #print STDOUT "$unpack_cmd\n";
if (system($unpack_cmd)) { if (system($unpack_cmd)) {
if ($? >> 8 == 255) { if ($? >> 8 == 255) {
die "Tarinstall failed\n"; die "Tarinstall failed (see $LOGDIR/blobs.log)\n";
} }
} }
...@@ -154,7 +158,7 @@ sub doboot() ...@@ -154,7 +158,7 @@ sub doboot()
} }
if (!$errors) { if (!$errors) {
system("touch /var/emulab/boot/rc.blobs-ran"); system("touch $BOOTDIR/rc.blobs-ran");
} }
exit($errors); exit($errors);
......
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