Commit e12ff3a3 authored by Leigh Stoller's avatar Leigh Stoller

Fixes so failures in tarfile fetching are reported to the user in the

protogeni response.
parent 0da9a93c
......@@ -2654,8 +2654,10 @@ sub SliverWorkAux($$$$$$$)
#
# Must do this after the mapper runs.
#
if (system("$TARFILES_SETUP $pid $eid")) {
print STDERR "Could not setup tarfiles\n";
$output = GeniUtil::ExecQuiet("$TARFILES_SETUP -q $pid $eid");
if ($?) {
$message = "Could not setup tarfiles:\n$output";
print STDERR $message;
goto bad;
}
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003, 2004, 2005, 2006 University of Utah and the Flux Group.
# Copyright (c) 2003-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use Getopt::Std;
use BSD::Resource;
......@@ -17,10 +15,13 @@ use POSIX qw(:signal_h);
#
sub usage()
{
print "Usage: $0 -u user URL localfile\n";
print "Usage: $0 [-q] -u user URL localfile\n";
exit(-1);
}
my $optlist = "qu:";
my $quiet = 0;
my $user;
#
# Configure variables
......@@ -62,16 +63,19 @@ if ($UID != 0) {
" Must be root to run this script!");
}
if (@ARGV != 4) {
my %options = ();
if (! getopts($optlist, \%options)) {
usage();
}
if ((shift @ARGV) ne '-u') {
die("*** $0:\n".
" Improper first argument. Must be the user name!\n");
if (defined($options{"q"})) {
$quiet = 1;
}
if (defined($options{"u"})) {
$user = $options{"u"};
}
if (@ARGV != 2 || !defined($user)) {
usage();
}
my $user = shift @ARGV;
my $URL = shift @ARGV;
my $localfile = shift @ARGV;
......@@ -160,7 +164,7 @@ if (! $pid) {
# Give parent a chance to react.
sleep(1);
exec("nice -15 $WGET --timestamping --no-verbose -O $localfile $URL");
exec("nice -15 $WGET -q -O $localfile $URL");
die("Could not exec wget!\n");
}
......@@ -182,7 +186,8 @@ if (($exit_status & 0xff) == SIGKILL) {
print STDERR "*** $msg\n";
exit(15);
} elsif ($exit_status) {
print STDERR "*** wget exited with status $exit_status\n";
print STDERR "*** wget exited with status $exit_status\n"
if (!$quiet);
} else {
#
# Change the permissions on the file so that other group members can
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003-2008 University of Utah and the Flux Group.
# Copyright (c) 2003-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use Getopt::Std;
use Socket;
......@@ -25,10 +23,12 @@ use Socket;
sub usage()
{
print "Usage: $0 pid eid\n";
print "Usage: $0 [-q] pid eid\n";
exit(-1);
}
my $optlist = "q";
my $quiet = 0;
#
# Functions
......@@ -84,6 +84,13 @@ use libArchive;
use Experiment;
use User;
my %options = ();
if (! getopts($optlist, \%options)) {
usage();
}
if (defined($options{"q"})) {
$quiet = 1;
}
if (@ARGV != 2) {
usage();
}
......@@ -286,12 +293,15 @@ if ($TESTMODE) {
# Actually fetch the tarballs
#
while (my ($URL, $localfile) = each %tofetch) {
print "Fetching $URL to $localfile\n";
print "Fetching $URL to $localfile\n"
if (!$quiet);
#
# Build up a new command line to do the fetch on ops
#
my $cmdargs = "$TB/bin/fetchtar.proxy ";
$cmdargs .= " -q "
if ($quiet);
$cmdargs .= " -u $user_uid $URL $localfile ";
#
......@@ -302,7 +312,7 @@ while (my ($URL, $localfile) = each %tofetch) {
$EUID = $UID = $SAVEUID;
if ($?) {
tbdie("Fetch of Tarball/RPM failed!");
tbdie("Fetch of Tarball/RPM failed: $URL");
}
}
......
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