Commit ac8449e3 authored by Eric Cano's avatar Eric Cano
Browse files

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the...

bug #72215: Remove the TAPEGATEWAYREQUEST table from the schema, and drop the triggers that populate it.

Fixed missing context (user, service class) in stager cmomands.
parent 0e43613f
......@@ -286,7 +286,7 @@ sub check_migrated_in_ns ( $ )
sub check_invalid ( $ )
{
my $file_name = shift;
my $stager_qry=`stager_qry -M $file_name`;
my $stager_qry=`su $environment{username} -c \"stager_qry -M $file_name\"`;
return $stager_qry=~ /INVALID/;
}
......@@ -294,7 +294,7 @@ sub check_invalid ( $ )
sub check_recalled_or_fully_migrated ( $ )
{
my $file_name = shift;
my $stager_qry=`stager_qry -M $file_name`;
my $stager_qry=`su $environment{username} -c \"stager_qry -M $file_name\"`;
return $stager_qry=~ /STAGED/;
}
......@@ -348,7 +348,7 @@ sub cleanup_migrated ()
for ( my $i =0; $i < scalar (@remote_files); $i++ ) {
my %f = %{$remote_files[$i]};
if ( $f{type} eq "file" && $f{status} eq "migrated" ) {
`su $environment{username} -c \"stager_rm -M $f{name}\"`;
print `su $environment{username} -c \"STAGE_SVCCLASS=dev stager_rm -M $f{name}\"`;
$remote_files[$i]->{status} = "invalidation requested";
print "t=".elapsed_time()."s. Removed $f{name} (was migrated) from stager.\n";
}
......@@ -361,7 +361,7 @@ sub stager_reget_from_tape ()
for ( my $i =0; $i < scalar (@remote_files); $i++ ) {
my %f = %{$remote_files[$i]};
if ( $f{type} eq "file" && $f{status} eq "on tape" ) {
`su $environment{username} -c \"stager_get -M $f{name}\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=dev stager_get -M $f{name}\"`;
$remote_files[$i]->{status} = "being recalled";
print "t=".elapsed_time()."s. Initiated recall for $f{name}.\n";
}
......@@ -454,10 +454,10 @@ sub check_remote_entries ()
# hand over the file to the user
`chown $environment{username} $local_copy`;
# rfcp the recalled copy
`su -c \"rfcp $entry{name} $local_copy\"`;
`su -c \"STAGE_SVCCLASS=dev rfcp $entry{name} $local_copy\"`;
# compute checksum, get size and get rid of file
my $local_size = ( -s $local_copy );
my $local_checksum_string = `adler32 $local_copy`;
my $local_checksum_string = `adler32 $local_copy 2>&1`;
my $local_checksum;
if ( $local_checksum_string =~ /adler32\(.*\) = \d+\, 0x([[:xdigit:]]+)/ ) {
$local_checksum = $1;
......@@ -499,7 +499,7 @@ sub count_to_be_moved ()
# Check that all the files have migrated
sub poll_moving_entries ( $$$ )
{
my ( $poll_interval, $timeout, $options ) = ( shift, shift );
my ( $poll_interval, $timeout, $options ) = ( shift, shift, shift );
my $starttime = `date +%s`;
while ( count_to_be_moved() > 0 && ((`date +%s` - $starttime) < $timeout) ) {
if ( check_remote_entries () ) {
......@@ -518,7 +518,7 @@ sub poll_moving_entries ( $$$ )
print "t=".elapsed_time()."s. All expected moves completed.\n";
return;
}
die "Timeout with ".count_to_be_migrated()." files to be migrated after $timeout s.";
die "Timeout with ".count_to_be_moved()." files to be migrated after $timeout s.";
}
......@@ -1519,7 +1519,7 @@ sub cleanup () {
#reverse order remotees removal to removes directories in the end.
print "Cleanup: removing ".$remote_files[$i]->{name}."\n";
if ($remote_files[$i]->{type} eq "file") {
`su $environment{username} -c \"stager_rm -M $remote_files[$i]->{name}\"`;
`su $environment{username} -c \"STAGE_SVCCLASS=dev stager_rm -M $remote_files[$i]->{name}\"`;
}
`su $environment{username} -c \"nsrm $remote_files[$i]->{name}\"`;
}
......
Supports Markdown
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