From 0c4252ab4bf7ae2b25538c9168d5082fa7eac516 Mon Sep 17 00:00:00 2001 From: Daria Phoebe Brashear Date: Fri, 3 Sep 2021 16:19:06 -0400 Subject: [PATCH 1/2] update maintainer info --- Makefile.PL | 2 +- README.pod | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index e0ff9e2..0332f02 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -16,7 +16,7 @@ WriteMakefile( MIN_PERL_VERSION => q{5.010}, VERSION => $version, ABSTRACT => q{AFS Command Utility Interface}, - AUTHOR => q{Phillip Moore }, + AUTHOR => q{Daria Phoebe Brashear }, LICENSE => q{unknown}, dist => { diff --git a/README.pod b/README.pod index 8ebb4a1..63fd751 100644 --- a/README.pod +++ b/README.pod @@ -80,9 +80,8 @@ found in the following documents: =head1 AUTHOR -This code is a product of the demented mind of: - - Phillip Moore +This code is a product of the demented mind of Phillip Moore +and is currently maintained by Daria Phoebe Brashear Feedback, patches, recommendations, adulations, and even flames are all welcome. Feed my ego (or try to shoot it down :-), please... From 316a9bc85d9178d81613d65f9c42c012171e44d3 Mon Sep 17 00:00:00 2001 From: Daria Phoebe Brashear Date: Wed, 29 Jun 2022 12:14:42 -0400 Subject: [PATCH 2/2] updates to allow use of AuriStor command syntax --- lib/AFS/Command/BOS.pm | 562 +++++---- lib/AFS/Command/BOS.pod | 1095 +++++++++--------- lib/AFS/Command/Base.pm | 869 ++++++++------ lib/AFS/Command/Base.pod | 152 ++- lib/AFS/Command/FS.pm | 1221 +++++++++---------- lib/AFS/Command/FS.pod | 1841 +++++++++++++---------------- lib/AFS/Command/PTS.pm | 541 +++++---- lib/AFS/Command/PTS.pod | 767 ++++++------ lib/AFS/Command/VOS.pm | 1931 ++++++++++++++++-------------- lib/AFS/Command/VOS.pod | 1996 +++++++++++++++----------------- lib/AFS/Object.pm | 65 +- lib/AFS/Object.pod | 14 +- lib/AFS/Object/ACL.pm | 24 +- lib/AFS/Object/BosServer.pm | 93 +- lib/AFS/Object/CacheManager.pm | 68 +- lib/AFS/Object/Cell.pm | 6 +- lib/AFS/Object/FileServer.pm | 28 +- lib/AFS/Object/Group.pm | 7 +- lib/AFS/Object/Instance.pm | 28 +- lib/AFS/Object/PTServer.pm | 126 +- lib/AFS/Object/Partition.pm | 65 +- lib/AFS/Object/Path.pm | 41 +- lib/AFS/Object/Principal.pm | 24 +- lib/AFS/Object/Server.pm | 6 +- lib/AFS/Object/Transaction.pm | 6 +- lib/AFS/Object/VLDB.pm | 73 +- lib/AFS/Object/VLDBEntry.pm | 19 +- lib/AFS/Object/VolServer.pm | 56 +- lib/AFS/Object/Volume.pm | 31 +- 29 files changed, 6118 insertions(+), 5637 deletions(-) diff --git a/lib/AFS/Command/BOS.pm b/lib/AFS/Command/BOS.pm index fe98ab8..f0b4988 100644 --- a/lib/AFS/Command/BOS.pm +++ b/lib/AFS/Command/BOS.pm @@ -7,53 +7,63 @@ use MooseX::Singleton; use English; use Carp; -extends qw(AFS::Command::Base); - +use AFS::Command::Base; use AFS::Object; use AFS::Object::BosServer; use AFS::Object::Instance; +use AFS::Object::Principal; +use AFS::Object::User; + +our @ISA = qw(AFS::Command::Base); +our $VERSION = '1.99'; sub getdate { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{getdate} ); + $self->{operation} = "getdate"; - my $directory = $args{dir} || q{/usr/afs/bin}; + my $directory = $args{dir} || '/usr/libexec/yfs'; - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); - while ( defined($_ = $self->_handle->getline) ) { + return unless $self->_save_stderr(); - chomp; + my $errors = 0; - next if not m{File \s+ $directory/(\S+) \s+ dated \s+ ([^,]+),}msx; + $errors++ unless $self->_exec_cmds(); - my $file = AFS::Object->new( - file => $1, - date => $2, - ); + while ( defined($_ = $self->{handle}->getline()) ) { - if ( m{\.BAK dated ([^,]+),}ms ) { - $file->_setAttribute( bak => $1 ); - } + chomp; - if ( m{\.OLD dated ([^,\.]+)}ms ) { - $file->_setAttribute( old => $1 ); - } + next unless m:File $directory/(\S+) dated ([^,]+),:; + + my $file = AFS::Object->new + ( + file => $1, + date => $2, + ); - $result->_addFile($file); + if ( /\.BAK dated ([^,]+),/ ) { + $file->_setAttribute( bak => $1 ); + } + + if ( /\.OLD dated ([^,\.]+)/ ) { + $file->_setAttribute( old => $1 ); + } + + $result->_addFile($file); } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -61,46 +71,56 @@ sub getdate { sub getlog { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{getlog} ); + $self->{operation} = "getlog"; my $redirect = undef; my $redirectname = undef; if ( $args{redirect} ) { - $redirectname = delete $args{redirect}; - $redirect = IO::File->new( qq{>$redirectname} ) || - croak qq{Unable to write to $redirectname: $ERRNO}; + $redirectname = delete $args{redirect}; + $redirect = IO::File->new(">$redirectname") || do { + $self->_Carp("Unable to write to $redirectname: $ERRNO"); + return; + }; } - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); - my $log = q{}; + return unless $self->_save_stderr(); - while ( defined($_ = $self->_handle->getline) ) { - next if m{^Fetching log file}ms; - if ( $redirect ) { - $redirect->print($_); - } else { - $log .= $_; - } + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); + + my $log = ""; + + while ( defined($_ = $self->{handle}->getline()) ) { + next if /^Fetching log file/; + if ( $redirect ) { + $redirect->print($_); + } else { + $log .= $_; + } } if ( $redirect ) { - $redirect->close || croak qq{Unable to close $redirectname: $ERRNO}; - $result->_setAttribute( log => $redirectname ); + $redirect->close()|| do { + $self->_Carp("Unable to close $redirectname: $ERRNO"); + $errors++ + }; + $result->_setAttribute( log => $redirectname ); } else { - $result->_setAttribute( log => $log ); + $result->_setAttribute( log => $log ); } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -108,29 +128,34 @@ sub getlog { sub getrestart { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{getrestart} ); + $self->{operation} = "getrestart"; - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); - while ( defined($_ = $self->_handle->getline) ) { + return unless $self->_save_stderr(); - if ( m{restarts at (.*)}ms || m{restarts (never)}ms ) { - $result->_setAttribute( restart => $1 ); - } elsif ( m{binaries at (.*)}ms || m{binaries (never)}ms ) { - $result->_setAttribute( binaries => $1 ); - } + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); + + while ( defined($_ = $self->{handle}->getline()) ) { + + if ( /restarts at (.*)/ || /restarts (never)/ ) { + $result->_setAttribute( restart => $1 ); + } elsif ( /binaries at (.*)/ || /binaries (never)/ ) { + $result->_setAttribute( binaries => $1 ); + } } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -138,25 +163,34 @@ sub getrestart { sub getrestricted { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{getrestricted} ); + $self->{operation} = "getrestricted"; - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); + + return unless $self->_save_stderr(); + + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); + + while ( defined($_ = $self->{handle}->getline()) ) { + + chomp; + + next unless m:Restricted mode is (\S+):; + + $result->_setAttribute( restricted => $1 ); - while ( defined($_ = $self->_handle->getline) ) { - if ( m{Restricted mode is (\S+)}ms ) { - $result->_setAttribute( restricted => $1 ); - } } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -164,37 +198,42 @@ sub getrestricted { sub listhosts { my $self = shift; - my %args = @_; + my (%args) = @_; + + my $result = AFS::Object::BosServer->new(); + + $self->{operation} = "listhosts"; - my $result = AFS::Object::BosServer->new; + return unless $self->_parse_arguments(%args); - $self->operation( q{listhosts} ); + return unless $self->_save_stderr(); - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); my @hosts = (); - while ( defined($_ = $self->_handle->getline) ) { + while ( defined($_ = $self->{handle}->getline()) ) { - chomp; + chomp; - if ( m{Cell name is (\S+)}msi ) { - $result->_setAttribute( cell => $1 ); - } + if ( /Cell name is (\S+)/i ) { + $result->_setAttribute( cell => $1 ); + } - if ( m{Host \d+ is (\S+)}msi ) { - push @hosts, $1; - } + if ( /Host \d+ is \[?([^\]]*)\]?/i ) { + push(@hosts,$1); + } } $result->_setAttribute( hosts => \@hosts ); - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -202,43 +241,48 @@ sub listhosts { sub listkeys { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{listkeys} ); + $self->{operation} = "listkeys"; - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); - while ( defined($_ = $self->_handle->getline) ) { + return unless $self->_save_stderr(); - chomp; + my $errors = 0; - if ( m{key (\d+)}ms ) { + $errors++ unless $self->_exec_cmds(); - my $key = AFS::Object->new( index => $1 ); + while ( defined($_ = $self->{handle}->getline()) ) { - if ( m{has cksum (\d+)}ms ) { - $key->_setAttribute( cksum => $1 ); - } elsif ( m{is \'([^\']+)\'}ms ) { - $key->_setAttribute( value => $1 ); - } + chomp; - $result->_addKey($key); + if ( /key (\d+)/ ) { - } + my $key = AFS::Object->new( index => $1 ); - if ( m{last changed on (.*)\.}ms ) { - $result->_setAttribute( keyschanged => $1 ); - } + if ( /has cksum (\d+)/ ) { + $key->_setAttribute( cksum => $1 ); + } elsif ( /is \'([^\']+)\'/ ) { + $key->_setAttribute( value => $1 ); + } + + $result->_addKey($key); + + } + + if ( /last changed on (.*)\./ ) { + $result->_setAttribute( keyschanged => $1 ); + } } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } @@ -246,151 +290,263 @@ sub listkeys { sub listusers { my $self = shift; - my %args = @_; + my (%args) = @_; - my $result = AFS::Object::BosServer->new; + my $result = AFS::Object::BosServer->new(); - $self->operation( q{listusers} ); + $self->{operation} = "listusers"; - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_parse_arguments(%args); - while ( defined($_ = $self->_handle->getline) ) { + return unless $self->_save_stderr(); - chomp; + my $errors = 0; - if ( m{^SUsers are: (.*)}ms ) { - $result->_setAttribute( susers => [split(/\s+/,$1)] ); + $errors++ unless $self->_exec_cmds(); + + while ( defined($_ = $self->{handle}->getline()) ) { + + chomp; + + if ( /^SUsers are: (.*)/ ) { + $result->_setAttribute( susers => [split(/\s+/,$1)] ); + } + # Auristor uses separate lines for each users + # XXX: there's a type associated with AuriStor users, e.g. + # gss 'user@YOUR-CELL-NAME.COM' + # to maintain compatibility, provide both results + # Original did not include realm! + if ( /^SUsers are:/ ) { + my @users; + while ( defined($_ = $self->{handle}->getline()) ) { + next unless ( /(\S+)\s+'(\S+)'/ ); + my $user = AFS::Object::User->new + ( + type => $1, + user => $2, + ); + $result->_addUser($user); + chomp; + (my $u = $2) =~ s/@\S+//; + push @users, $u unless ( grep /^$u$/, @users ); } + $result->_setAttribute( susers => \@users ); + } } - $self->_restore_stderr; - $self->_reap_commands; + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } +# +# XXX -- we might want to provide parsing of the bos salvage output, +# but for now, this is a non-parsed command. +# + +# sub salvage { + +# my $self = shift; +# my (%args) = @_; + +# my $result = AFS::Object::BosServer->new(); + +# $self->{operation} = "salvage"; + +# return unless $self->_parse_arguments(%args); + +# return unless $self->_save_stderr(); + +# my $errors = 0; + +# $errors++ unless $self->_exec_cmds(); + +# while ( defined($_ = $self->{handle}->getline()) ) { + + + +# } + +# $errors++ unless $self->_reap_cmds(); +# $errors++ unless $self->_restore_stderr(); + +# return if $errors; +# return $result; + +# } + sub status { my $self = shift; - my %args = @_; + my (%args) = @_; + + my $result = AFS::Object::BosServer->new(); - my $result = AFS::Object::BosServer->new; + $self->{operation} = "status"; - $self->operation( q{status} ); + return unless $self->_parse_arguments(%args); - $self->_parse_arguments(%args); - $self->_save_stderr; - $self->_exec_commands; + return unless $self->_save_stderr(); + + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); my $instance = undef; - while ( defined($_ = $self->_handle->getline) ) { + while ( defined($_ = $self->{handle}->getline()) ) { - chomp; + chomp; - if ( m{inappropriate access}ms ) { - $result->_setAttribute( access => 1 ); - next; - } + if ( /inappropriate access/ ) { + $result->_setAttribute( access => 1 ); + next; + } - if ( m{Instance (\S+),}ms ) { + if ( /Instance (\S+),/ ) { - if ( defined $instance ) { - $result->_addInstance($instance); - } + if ( defined $instance ) { + $result->_addInstance($instance); + } - $instance = AFS::Object::Instance->new( instance => $1 ); + $instance = AFS::Object::Instance->new( instance => $1 ); - # - # This is ugly, since the order and number of these - # strings varies. - # - if ( m{\(type is (\S+)\)}ms ) { - $instance->_setAttribute( type => $1 ); - } + # + # This is ugly, since the order and number of these + # strings varies. + # + if ( /\(type is (\S+)\)/ ) { + $instance->_setAttribute( type => $1 ); + } - if ( m{(disabled|temporarily disabled|temporarily enabled),}ms ) { - $instance->_setAttribute( state => $1 ); - } + if ( /(disabled|temporarily disabled|temporarily enabled),/ ) { + $instance->_setAttribute( state => $1 ); + } - if ( m{stopped for too many errors}ms ) { - $instance->_setAttribute( errorstop => 1 ); - } + if ( /stopped for too many errors/ ) { + $instance->_setAttribute( errorstop => 1 ); + } - if ( m{has core file}ms ) { - $instance->_setAttribute( core => 1 ); - } + if ( /has core file/ ) { + $instance->_setAttribute( core => 1 ); + } - if ( m{currently (.*)\.$}ms ) { - $instance->_setAttribute( status => $1 ); - } + if ( /currently (.*)\.$/ ) { + $instance->_setAttribute( status => $1 ); + } - } + } - if ( m{Auxiliary status is: (.*)\.$}ms ) { - $instance->_setAttribute( auxiliary => $1 ); - } + if ( /Auxiliary status is: (.*)\.$/ ) { + $instance->_setAttribute( auxiliary => $1 ); + } - if ( m{Process last started at (.*) \((\d+) proc starts\)}ms ) { - $instance->_setAttribute( - startdate => $1, - startcount => $2, - ); - } + if ( /Process last started at (.*) \((\d+) proc starts\)/ ) { + $instance->_setAttribute + ( + startdate => $1, + startcount => $2, + ); + } - if ( m{Last exit at (.*)}ms ) { - $instance->_setAttribute( exitdate => $1 ); - } + if ( /Last exit at (.*)/ ) { + $instance->_setAttribute( exitdate => $1 ); + } - if ( m{Last error exit at ([^,]+),}ms ) { + if ( /Last error exit at ([^,]+),/ ) { - $instance->_setAttribute( errorexitdate => $1 ); + $instance->_setAttribute( errorexitdate => $1 ); - if ( m{due to shutdown request}ms ) { - $instance->_setAttribute( errorexitdue => q{shutdown} ); - } + if ( /due to shutdown request/ ) { + $instance->_setAttribute( errorexitdue => 'shutdown' ); + } - if ( m{due to signal (\d+)}ms ) { - $instance->_setAttribute( - errorexitdue => q{signal}, - errorexitsignal => $1, - ); - } + if ( /due to signal (\d+)/ ) { + $instance->_setAttribute + ( + errorexitdue => 'signal', + errorexitsignal => $1, + ); + } - if ( m{by exiting with code (\d+)}ms ) { - $instance->_setAttribute( - errorexitdue => q{code}, - errorexitcode => $1, - ); - } + if ( /by exiting with code (\d+)/ ) { + $instance->_setAttribute + ( + errorexitdue => 'code', + errorexitcode => $1, + ); + } - } + } - if ( m{Command\s+(\d+)\s+is\s+\'(.*)\'}ms ) { - my $command = AFS::Object->new( - index => $1, - command => $2, - ); - $instance->_addCommand($command); - } + if ( /Command\s+(\d+)\s+is\s+\'(.*)\'/ ) { + my $command = AFS::Object->new + ( + index => $1, + command => $2, + ); + $instance->_addCommand($command); + } - if ( m{Notifier\s+is\s+\'(.*)\'}ms ) { - $instance->_setAttribute( notifier => $1 ); - } + if ( /Notifier\s+is\s+\'(.*)\'/ ) { + $instance->_setAttribute( notifier => $1 ); + } } if ( defined $instance ) { - $result->_addInstance($instance); + $result->_addInstance($instance); + } + + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + + return if $errors; + return $result; + +} + +sub whoami { + + my $self = shift; + my (%args) = @_; + + my $result = AFS::Object::BosServer->new(); + + $self->{operation} = "whoami"; + + return unless $self->_parse_arguments(%args); + + return unless $self->_save_stderr(); + + my $errors = 0; + + $errors++ unless $self->_exec_cmds(); + + while ( defined($_ = $self->{handle}->getline()) ) { + + chomp; + + next unless ( /Current identity is\s+(\S+)\s+'(\S+)'/ ); + my $user = AFS::Object::User->new + ( + type => $1, + user => $2, + ); + $result->_addUser($user); + } - $self->_restore_stderr; - $self->_reap_commands; + print Dumper( $result ); + + $errors++ unless $self->_reap_cmds(); + $errors++ unless $self->_restore_stderr(); + return if $errors; return $result; } diff --git a/lib/AFS/Command/BOS.pod b/lib/AFS/Command/BOS.pod index 9613e10..f0c4b11 100644 --- a/lib/AFS/Command/BOS.pod +++ b/lib/AFS/Command/BOS.pod @@ -7,11 +7,17 @@ AFS::Command::BOS - OO API to the AFS bos command use AFS::Command::BOS; - my $bos = AFS::Command::BOS->new; + my $bos = AFS::Command::BOS->new(); - my $bos = AFS::Command::BOS->new( command => $path_to_your_bos_binary ); + my $bos = AFS::Command::BOS->new + ( + command => $path_to_your_bos_binary, + ); - my $bos = AFS::Command::BOS->new( localauth => 1 ); + my $bos = AFS::Command::BOS->new + ( + localauth => 1, + ); =head1 DESCRIPTION @@ -28,14 +34,12 @@ class. See that documentation for details. =item new +=item errors + =item supportsOperation =item supportsArgument -=item supportsArgumentRequired - -=item supportsArgumentOptional - =back =head1 METHODS (with complex return values) @@ -50,20 +54,21 @@ The bos help string is: bos getdate: get dates for programs Usage: bos getdate -server -file + [-dir ] - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->getdate( + my $result = $bos->getdate + ( # Required arguments - server => $server, - file => $file, # OR [ $file1, $file2, ... ] + server => $server, + file => $file, # OR [ $file1, $file2, ... ] # Optional arguments - dir => $dir, - cell => $cell, - noauth => 1, - localauth => 1, - ); + dir => $dir, + cell => $cell, + noauth => 1, + localauth => 1, + ); =item Return Values @@ -71,14 +76,15 @@ This method returns an AFS::Object::BosServer object, which contains one or more generic AFS::Object, one for each file specified in the arguments. - my $result = $bos->getdate( - file => [qw( bosserver vlserver ptserver )], - cell => $cell, - ); + my $result = $bos->getdate + ( + file => [ 'bosserver', 'vlserver', 'ptserver' ], + cell => $cell, + ) || die $bos->errors(); - foreach my $fileobj ( $result->getFiles ) { - my ($file,$date) = ( $fileobj->file, $fileobj->date ); - print qq{File $file has date $date\n}; + foreach my $fileobj ( $result->getFiles() ) { + my ($file,$date) = ($fileobj->file(),$fileobj->date()); + print "File $file has date $date\n"; } Each of these objects has the following attributes and methods: @@ -88,28 +94,28 @@ B This object is nothing more than a container for the generic objects for each file. It has several methods for extracting the file objects: - Methods Returns - ------- ------- - getFileNames a list of filenames - getFiles a list of AFS::Object objects - getFile($filename) the AFS::Object object for $filename + Methods Returns + ------- ------- + getFileNames() a list of filenames + getFiles() a list of AFS::Object objects + getFile($filename) the AFS::Object object for $filename B The following attributes should always be present: - Attributes Values - ---------- ------ - file fully qualified pathname to the file - date last modified timestamp on the file + Attributes Values + ---------- ------ + file fully qualified pathname to the file + date last modified timestamp on the file The following attributes may be present, if there are .BAK or .OLD versions of the file. - Attributes Values - ---------- ------ - bak last modified timestamp on the .BAK file - old last modified timestamp on the .OLD file + Attributes Values + ---------- ------ + bak last modified timestamp on the .BAK file + old last modified timestamp on the .OLD file =back @@ -123,26 +129,27 @@ The bos help string is: bos getlog: examine log file Usage: bos getlog -server -file - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->getlog( + my $result = $bos->getlog + ( # Required arguments - server => $server, - file => $file, + server => $server, + file => $file, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, + cell => $cell, + noauth => 1, + localauth => 1, # Enhanced arguments - redirect => $redirect, - ); + redirect => $redirect, + ); The 'redirect' argument is the name of a file to "redirect" the log file to. By default, 'bos getlog' dumps the contents of the requested file to stdout, which is not what you normally want in an application. -The value of this argument is passed directly to IO::File->open. +The value of this argument is passed directly to IO::File->open(). If this argument is not specified, then the contents of the logfile are stashed in an attribute of the returned object. @@ -152,37 +159,39 @@ are stashed in an attribute of the returned object. This method returns an AFS::Object::BosServer object, which contains one attribute. - my $result = $bos->getlog( - server => $server, - file => q{/usr/afs/logs/VolserLog}, - redirect => qq{/var/tmp/VolserLog.$PID}, - ); + my $result = $bos->getlog + ( + server => $server, + file => "/var/log/yfs/VolserLog", + redirect => "/var/tmp/VolserLog.$$", + ) || die $bos->errors(); - my $logfile = IO::File->new( qq{new("getline) ) { - .... + while ( defined($_ = $logfile->getline()) ) { + .... } # Alternately, the memory pig way: - my $result = $bos->getlog( - server => $server, - file => q{/usr/afs/logs/VolserLog}, - ); + my $result = $bos->getlog + ( + server => $server, + file => "/var/log/yfs/VolserLog", + ); - foreach ( split( m{\n+}msx ,$result->log ) ) { - .... + foreach ( split(/\n+/,$result->log()) ) { + .... } The object has the following attribute: B - Attributes Values - ---------- ------ - log Contents of the logfile, or the redirect pathname + Attributes Values + ---------- ------ + log Contents of the logfile, or the redirect pathname If redirect was given, then this attribute is simply same pathname. If redirect was not given, then the value of this attribute is the @@ -207,90 +216,41 @@ The bos help string is: bos getrestart: get restart times Usage: bos getrestart -server [-cell ] - [-noauth] [-localauth] + [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->getrestart( + my $result = $bos->getrestart + ( # Required arguments - server => $server, + server => $server, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =item Return Values This method returns an AFS::Object::BosServer object, which contains two attributes. - my $result = $bos->getrestart( - server => $server, - cell => $cell, - ); - - print q{Binary restart time is } . $result->binaries . qq{\n}; - print q{Server restart time is } . $result->restart . qq{\n}; - -The object has the following attributes: - -B - - Attributes Values - ---------- ------ - restart The server restart time - binaries The restart time when there are new, updated binaries - -=back - -=head2 getrestricted - -=over - -=item Arguments - -The bos help string is: - - bos getrestricted: get restrict mode - Usage: bos getrestricted -server [-cell ] - [-noauth] [-localauth] - -The corresponding method invocation looks like: - - my $result = $bos->getrestricted( - # Required arguments - server => $server, - # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); - -=item Return Values - -This method returns an AFS::Object::BosServer object, which -contains one attribute. - - my $result = $bos->getrestricted( - server => $server, - cell => $cell, - ); - - my $restricted = $result->restricted; - if ( $restricted ) { - print qq{Server $server in cell $cell has restricted mode on\n}; - } else { - print qq{Server $server in cell $cell has restricted mode off\n}; - } + my $result = $bos->getrestart + ( + server => $server, + cell => $cell, + ) || die $bos->errors(); + print "Binary restart time is " . $result->binaries() . "\n"; + print "Server restart time is " . $result->restart() . "\n"; The object has the following attributes: B - Attributes Values - ---------- ------ - restricted on | off + Attributes Values + ---------- ------ + restart The server restart time + binaries The restart time when there are new, updated binaries =back @@ -304,43 +264,44 @@ The bos help string is: bos listhosts: get cell host list Usage: bos listhosts -server [-cell ] - [-noauth] [-localauth] + [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->listhosts( + my $result = $bos->listhosts + ( # Required arguments - server => $server, + server => $server, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =item Return Values This method returns an AFS::Object::BosServer object, which contains one attribute. - my $result = $bos->listhosts( - server => $server, - cell => $cell, - ); - - my $hosts = $result->hosts; - print qq{Server $server in cell $cell has hosts:\n}; - foreach my $host ( @{ $hosts } ) { - print qq{\t$host\n}; + my $result = $bos->listhosts + ( + server => $server, + cell => $cell, + ) || die $bos->errors(); + my $hosts = $result->hosts(); + print "Server $server in cell $cell has hosts:\n" + foreach my $host ( @$hosts ) { + print "\t$host\n"; } The object has the following attributes: B - Attributes Values - ---------- ------ - hosts ARRAY reference of hostnames - cell Cell name + Attributes Values + ---------- ------ + hosts ARRAY reference of hostnames + cell Cell name =back @@ -354,83 +315,84 @@ The bos help string is: bos listkeys: list keys Usage: bos listkeys -server [-showkey] - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] Where: -showkey show the actual key rather than the checksum The corresponding method invocation looks like: - my $result = $bos->listkeys( + my $result = $bos->listkeys + ( # Required arguments - server => $server, + server => $server, # Optional arguments - showkey => 1, - cell => $cell, - noauth => 1, - localauth => 1, - ); + showkey => 1, + cell => $cell, + noauth => 1, + localauth => 1, + ); =item Return Values -This method returns an AFS::Object::BosServer object, which contains -one or more AFS::Object objects, each of which represents a single -authentication key on the server. - - my $result = $bos->listkeys( - server => $server, - cell => $cell, - ); - - print qq{Server $server in cell $cell has the following keys:\n}; - foreach my $key ( $result->getKeys ) { - my ($index,$cksum) = ( $key->index, $key->cksum ); - print qq{\t$index => $cksum\n}; +This method returns an AFS::Object::BosServer object, which +contains one or more AFS::Object objects, each of which +represents a single authentication key on the server. + + my $result = $bos->listkeys + ( + server => $server, + cell => $cell, + ) || die $bos->errors(); + print "Server $server in cell $cell has the following keys:\n"; + foreach my $key ( $result->getKeys() ) { + my ($index,$cksum) = ($key->index(),$key->cksum()); + print "\t$index => $cksum\n"; } - my $result = $bos->listkeys( - server => $server, - cell => $cell, - showkey => 1, - ); - - print qq{Server $server in cell $cell has the following keys:\n}; - foreach my $key ( $result->getKeys ) { - my ($index,$value) = ( $key->index, $key->value ); - print qq{\t$index => $value\n}; + my $result = $bos->listkeys + ( + server => $server, + cell => $cell, + showkey => 1, + ) || die $bos->errors(); + print "Server $server in cell $cell has the following keys:\n"; + foreach my $key ( $result->getKeys() ) { + my ($index,$value) = ($key->index(),$key->value()); + print "\t$index => $cksum\n"; } The objects have the following attributes and methods: B - Attributes Values - ---------- ------ - keychanged Date the keys were last changed + Attributes Values + ---------- ------ + keychanged Date the keys were last changed - Methods Returns - ------- ------- - getKeyIndexes list of numeric key indexes - getKeys list of AFS::Object objects - getKey($index) the AFS::Object object for the key with index $index + Methods Returns + ------- ------- + getKeyIndexes() list of numeric key indexes + getKeys() list of AFS::Object objects + getKey($index) the AFS::Object object for the key with index $index B The following attribute is always present: - Attributes Values - ---------- ------ - index Numeric index of the key + Attributes Values + ---------- ------ + index Numeric index of the key The following attribute is present when the 'showkey' argument is given: - Attributes Values - ---------- ------ - value Value of the key, in octal, as a string + Attributes Values + ---------- ------ + value Value of the key, in octal, as a string The following attribute is present when the 'showkey' argument is B given: - Attributes Values - ---------- ------ - cksum Numeric check sum of the key + Attributes Values + ---------- ------ + cksum Numeric check sum of the key =back @@ -444,42 +406,43 @@ The bos help string is: bos listusers: list super-users Usage: bos listusers -server [-cell ] - [-noauth] [-localauth] + [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->listusers( + my $result = $bos->listusers + ( # Required arguments - server => $server, + server => $server, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =item Return Values This method returns an AFS::Object::BosServer object, which contains one attribute. - my $result = $bos->listusers( - server => $server, - cell => $cell, - ); - - my $users = $result->susers; - print qq{Server $server in cell $cell has users:\n}; - foreach my $user ( @{ $users } ) { - print qq{\t$user\n}; + my $result = $bos->listusers + ( + server => $server, + cell => $cell, + ) || die $bos->errors(); + my $users = $result->susers(); + print "Server $server in cell $cell has users:\n" + foreach my $user ( @$users ) { + print "\t$user\n"; } The object has the following attribute: B - Attributes Values - ---------- ------ - susers ARRAY reference of super user names + Attributes Values + ---------- ------ + susers ARRAY reference of super user names =back @@ -493,21 +456,22 @@ The bos help string is: bos status: show server instance status Usage: bos status -server [-instance +] - [-long] [-cell ] [-noauth] [-localauth] + [-long] [-cell ] [-noauth] [-localauth] Where: -long long status The corresponding method invocation looks like: - my $result = $bos->status( + my $result = $bos->status + ( # Required arguments - server => $server, + server => $server, # Optional arguments - instance => $instance, # OR [ $inst1, $inst2, ... ], - cell => $cell, - long => 1, - noauth => 1, - localauth => 1, - ); + instance => $instance, # OR [ $inst1, $inst2, ... ], + cell => $cell, + long => 1, + noauth => 1, + localauth => 1, + ); =item Return Values @@ -516,20 +480,20 @@ contains one optional attribute, and one or more AFS::Object::Instance objects, each of which represents a single instance of a bosserver managed process on the server. - my $result = $bos->status( - server => $server, - long => 1, - ); - - foreach my $instanceobj ( $result->getInstances ) { - my $instance = $instanceobj->instance; - my $status = $instanceobj->status; - print qq{Instance $instance has status $status\n}; - foreach my $commandobj ( $instance->getCommands ) { - my $index = $commandobj->index; - my $command = $commandobj->command; - print qq{\tCmd $index is '$command'\n}; - } + my $result = $bos->status + ( + server => $server, + long => 1, + ) || die $bos->errors(); + foreach my $instanceobj ( $result->getInstances() ) { + my $instance = $instanceobj->instance(); + my $status = $instanceobj->status(); + print "Instance $instance has status $status\n"; + foreach my $commandobj ( $instance->getCommands() ) { + my $index = $commandobj->index(); + my $command = $commandobj->command(); + print "\tCmd $index is '$command'\n"; + } } The objects have the following attributes and methods: @@ -539,80 +503,80 @@ B The following attribute is only present when "bos status" reports inappropriate access on directories: - Attributes Values - ---------- ------ - access Boolean, true indicating a potential security problem + Attributes Values + ---------- ------ + access Boolean, true indicating a potential security problem The following methods can be used to extract the instance objects: - Methods Returns - ------- ------- - getInstanceNames list of instance names - getInstances list of AFS::Object::Instance objects - getInstance($name) one AFS::Object::Instance object for the instance $name + Methods Returns + ------- ------- + getInstanceNames() list of instance names + getInstances() list of AFS::Object::Instance objects + getInstance($name) one AFS::Object::Instance object for the instance $name B The following attributes are always present: - Attributes Values - ---------- ------ - instance Name of the instance - status Status string (running normally, shutdown, etc.) + Attributes Values + ---------- ------ + instance Name of the instance + status Status string (running normally, shutdown, etc.) The following attribute is always present is the instance is of type 'cron': - Attributes Values - ---------- ------ - auxiliary Auxiliary status (date the next execution) + Attributes Values + ---------- ------ + auxiliary Auxiliary status (date the next execution) The following attributes are always available when the 'long' argument is specified: - Attributes Values - ---------- ------ - type "cron", "simple", or "fs" - startdate Date when the process was last started - startcount Number of times the process has started, - since the bosserver was started - exitdate Date when the process last exited + Attributes Values + ---------- ------ + type "cron", "simple", or "fs" + startdate Date when the process was last started + startcount Number of times the process has started, + since the bosserver was started + exitdate Date when the process last exited The following attributes are optionally available, depending on the state of the instance, when the 'long' argument is specified: - Attributes Values - ---------- ------ - notifier Path to the notifier application for this instance - state "temporarily disabled", or "disabled", or "temporarily enabled" - errorstop Boolean, indicating the process was - "stopped for too many errors" - core Boolean, indicating the instance has a core file - errorexitdate Date when the process last exited with an error - errorexitdue "shutdown", or "signal", or "code" (present only when - "errorexitdate" attribute is present) - errorexitsignal Signal that cause the error exit (present only when - "errorexitdue" eq "signal") - errorexitcode Exit code from last error exit (present only when - "errorexitdue" eq "code") + Attributes Values + ---------- ------ + notifier Path to the notifier application for this instance + state "temporarily disabled", or "disabled", or "temporarily enabled" + errorstop Boolean, indicating the process was + "stopped for too many errors" + core Boolean, indicating the instance has a core file + errorexitdate Date when the process last exited with an error + errorexitdue "shutdown", or "signal", or "code" (present only when + "errorexitdate" attribute is present) + errorexitsignal Signal that cause the error exit (present only when + "errorexitdue" eq "signal") + errorexitcode Exit code from last error exit (present only when + "errorexitdue" eq "code") The following methods can be used to extract the command objects, which are also only present when the 'long' argument is specified. - Methods Returns - ------- ------- - getCommandIndexes list of numeric indexes for the commands - getCommands list of AFS::Object objects for all commands - getCommand($index) the AFS::Object object for the command with index $index + Methods Returns + ------- ------- + getCommandIndexes() list of numeric indexes for the commands + getCommands() list of AFS::Object objects for all commands + getCommand($index) the AFS::Object object for the command with index $index B (Commands) The following pair of attributes are always present: - Attributes Values - ---------- ------ - index Numerical index of the command - command Command string + Attributes Values + ---------- ------ + index Numerical index of the command + command Command string =back @@ -627,20 +591,22 @@ The bos help string is: bos addhost: add host to cell dbase Usage: bos addhost -server -host + - [-clone] [-cell ] [-noauth] [-localauth] + [-clone] [-cell ] [-noauth] [-localauth] + Where: -clone vote doesn't count The corresponding method invocation looks like: - my $result = $bos->addhost( + my $result = $bos->addhost + ( # Required arguments - server => $server, - host => $host, # OR [ $host1, $host2, ... ] + server => $server, + host => $host, # OR [ $host1, $host2, ... ] # Optional arguments - clone => 1, - cell => $cell, - noauth => 1, - localauth => 1, - ); + clone => 1, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 addkey @@ -648,20 +614,21 @@ The bos help string is: bos addkey: add keys to key dbase (kvno 999 is bcrypt) Usage: bos addkey -server [-key ] -kvno - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->addkey( + my $result = $bos->addkey + ( # Required arguments - server => $server, - kvno => $kvno, + server => $server, + kvno => $kvno, # Optional arguments - key => $key, - cell => $cell, - noauth => 1, - localauth => 1, - ); + key => $key, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 adduser @@ -669,19 +636,20 @@ The bos help string is: bos adduser: add users to super-user list Usage: bos adduser -server -user + - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->adduser( + my $result = $bos->adduser + ( # Required arguments - server => $server, - user => $user, # OR [ $user1, $user2, ... ] + server => $server, + user => $user, # OR [ $user1, $user2, ... ] # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 blockscanner @@ -689,18 +657,19 @@ The bos help string is: bos blockscanner: block scanner daemon from making migration requests Usage: bos blockscanner -server [-cell ] - [-noauth] [-localauth] + [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->blockscanner( + my $result = $bos->blockscanner + ( # Required arguments - server => $server, + server => $server, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 create @@ -708,23 +677,24 @@ The bos help string is: bos create: create a new server instance Usage: bos create -server -instance - -type -cmd + [-notifier ] - [-cell ] [-noauth] [-localauth] + -type -cmd + [-notifier ] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->create( + my $result = $bos->create + ( # Required arguments - server => $server, - instance => $instance, - type => $type, - cmd => $cmd, # OR [ $cmd1, $cmd2, ... ] + server => $server, + instance => $instance, + type => $type, + cmd => $cmd, # OR [ $cmd1, $cmd2, ... ] # Optional arguments - notifier => $notifier, - cell => $cell, - noauth => 1, - localauth => 1, - ); + notifier => $notifier, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 delete @@ -732,19 +702,20 @@ The bos help string is: bos delete: delete a server instance Usage: bos delete -server -instance + - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->delete( + my $result = $bos->delete + ( # Required arguments - server => $server, - instance => $instance, # OR [ $inst1, $inst2, ... ] + server => $server, + instance => $instance, # OR [ $inst1, $inst2, ... ] # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 exec @@ -752,19 +723,20 @@ The bos help string is: bos exec: execute shell command on server Usage: bos exec -server -cmd - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->exec( + my $result = $bos->exec + ( # Required arguments - server => $server, - cmd => $cmd, + server => $server, + cmd => $cmd, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 install @@ -772,20 +744,21 @@ The bos help string is: bos install: install program Usage: bos install -server -file + - [-dir ] [-cell ] [-noauth] [-localauth] + [-dir ] [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->install( + my $result = $bos->install + ( # Required arguments - server => $server, - file => $file, # OR [ $file1, $file2, ... ] + server => $server, + file => $file, # OR [ $file1, $file2, ... ] # Optional arguments - dir => $dir, - cell => $cell, - noauth => 1, - localauth => 1, - ); + dir => $dir, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 prune @@ -793,22 +766,27 @@ The bos help string is: bos prune: prune server files Usage: bos prune -server [-bak] [-old] [-core] [-all] - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] + Where: -bak delete .BAK files + -old delete .OLD files + -core delete core files + -all delete all junk files The corresponding method invocation looks like: - my $result = $bos->prune( + my $result = $bos->prune + ( # Required arguments - server => $server, + server => $server, # Optional arguments - bak => 1, - old => 1, - core => 1, - all => 1, - cell => $cell, - noauth => 1, - localauth => 1, - ); + bak => 1, + old => 1, + core => 1, + all => 1, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 removehost @@ -816,19 +794,20 @@ The bos help string is: bos removehost: remove host from cell dbase Usage: bos removehost -server -host + - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->removehost( + my $result = $bos->removehost + ( # Required arguments - server => $server, - host => $host, # OR [ $host1, $host2, ... ] + server => $server, + host => $host, # OR [ $host1, $host2, ... ] # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 removekey @@ -836,19 +815,20 @@ The bos help string is: bos removekey: remove keys from key dbase Usage: bos removekey -server -kvno + - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->removekey( + my $result = $bos->removekey + ( # Required arguments - server => $server, - kvno => $kvno, # OR [ $kvno1, $kvno2, ... ] + server => $server, + kvno => $kvno, # OR [ $kvno1, $kvno2, ... ] # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 removeuser @@ -856,19 +836,20 @@ The bos help string is: bos removeuser: remove users from super-user list Usage: bos removeuser -server -user + - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->removeuser( + my $result = $bos->removeuser + ( # Required arguments - server => $server, - user => $user, # OR [ $user1, $user2, ... ] + server => $server, + user => $user, # OR [ $user1, $user2, ... ] # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 restart @@ -876,21 +857,24 @@ The bos help string is: bos restart: restart processes Usage: bos restart -server [-instance +] [-bosserver] - [-all] [-cell ] [-noauth] [-localauth] + [-all] [-cell ] [-noauth] [-localauth] + Where: -bosserver restart bosserver + -all restart all processes The corresponding method invocation looks like: - my $result = $bos->restart( + my $result = $bos->restart + ( # Required arguments - server => $server, + server => $server, # Optional arguments - instance => $instance, # OR [ $inst1, $inst2, ... ] - bosserver => 1, - all => 1, - cell => $cell, - noauth => 1, - localauth => 1, - ); + instance => $instance, # OR [ $inst1, $inst2, ... ] + bosserver => 1, + all => 1, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 salvage @@ -898,73 +882,72 @@ The bos help string is: bos salvage: salvage partition or volumes Usage: bos salvage -server [-partition ] - [-volume ] - [-file ] [-all] [-showlog] - [-parallel <# of max parallel partition salvaging>] - [-tmpdir ] - [-orphans ] [-forceDAFS] [-debug] [-nowrite] - [-force] [-oktozap] [-rootfiles] [-salvagedirs] [-blockreads] - [-ListResidencies] [-SalvageRemote] [-SalvageArchival] - [-IgnoreCheck] [-ForceOnLine] [-UseRootDirACL] - [-TraceBadLinkCounts] [-DontAskFS] [-LogLevel <(MR-AFS) log level>] - [-rxdebug] [-cell ] [-noauth] [-localauth] + [-volume ] + [-file ] [-all] [-showlog] + [-parallel <# of max parallel partition salvaging>] + [-tmpdir ] + [-orphans ] [-debug] [-nowrite] + [-force] [-oktozap] [-rootfiles] [-salvagedirs] [-blockreads] + [-ListResidencies] [-SalvageRemote] [-SalvageArchival] + [-IgnoreCheck] [-ForceOnLine] [-UseRootDirACL] + [-TraceBadLinkCounts] [-DontAskFS] [-LogLevel <(MR-AFS) log level>] + [-rxdebug] [-cell ] [-noauth] [-localauth] Where: -all salvage whole server - -showlog display salvage log - -forceDAFS (DAFS) force salvage of demand attach fileserver - -debug (MR-AFS) Run in Debugging mode - -nowrite (MR-AFS) Run readonly/test mode - -force (MR-AFS) Force full salvaging - -oktozap (MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag - -rootfiles (MR-AFS) Show files owned by root - debugging flag - -salvagedirs (MR-AFS) Force rebuild/salvage of all directories - -blockreads (MR-AFS) Read smaller blocks to handle IO/bad blocks - -ListResidencies (MR-AFS) Just list affected file residencies - debugging flag - -SalvageRemote (MR-AFS) Salvage storage systems that are not directly attached - -SalvageArchival (MR-AFS) Salvage HSM storage systems - -IgnoreCheck (MR-AFS) Don't perform VLDB safety check when deleting unreferenced files. - Only a good idea in single server cell. - -ForceOnLine (MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly. - -UseRootDirACL (MR-AFS) Use the root directory ACL for lost+found directory if it is created. - -TraceBadLinkCounts (MR-AFS) Print out lines about volume reference count changes. - -DontAskFS (MR-AFS) Don't ask fileserver to take volume offline. THIS IS VERY DANGEROUS. - -rxdebug (MR-AFS) Write out rx debug information. + -showlog display salvage log + -debug (MR-AFS) Run in Debugging mode + -nowrite (MR-AFS) Run readonly/test mode + -force (MR-AFS) Force full salvaging + -oktozap (MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag + -rootfiles (MR-AFS) Show files owned by root - debugging flag + -salvagedirs (MR-AFS) Force rebuild/salvage of all directories + -blockreads (MR-AFS) Read smaller blocks to handle IO/bad blocks + -ListResidencies (MR-AFS) Just list affected file residencies - debugging flag + -SalvageRemote (MR-AFS) Salvage storage systems that are not directly attached + -SalvageArchival (MR-AFS) Salvage HSM storage systems + -IgnoreCheck (MR-AFS) Don't perform VLDB safety check when deleting unreferenced files. + Only a good idea in single server cell. + -ForceOnLine (MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly. + -UseRootDirACL (MR-AFS) Use the root directory ACL for lost+found directory if it is created. + -TraceBadLinkCounts (MR-AFS) Print out lines about volume reference count changes. + -DontAskFS (MR-AFS) Don't ask fileserver to take volume offline. THIS IS VERY DANGEROUS. + -rxdebug (MR-AFS) Write out rx debug information. The corresponding method invocation looks like: - my $result = $bos->salvage( + my $result = $bos->salvage + ( # Required arguments - server => $server, + server => $server, # Optional arguments - partition => $partition, - volume => $volume, - file => $file, - all => 1, - showlog => 1, - parallel => $parallel, - tmpdir => $tmpdir, - orphans => $orphans, - forceDAFS => 1, - debug => 1, - nowrite => 1, - force => 1, - oktozap => 1, - rootfiles => 1, - salvagedirs => 1, - blockreads => 1, - ListResidencies => 1, - SalvageRemote => 1, - SalvageArchival => 1, - IgnoreCheck => 1, - ForceOnLine => 1, - UseRootDirACL => 1, - TraceBadLinkCounts => 1, - DontAskFS => 1, - LogLevel => $loglevel, - rxdebug => 1, - cell => $cell, - noauth => 1, - localauth => 1, - ); + partition => $partition, + volume => $volume, + file => $file, + all => 1, + showlog => 1, + parallel => $parallel, + tmpdir => $tmpdir, + orphans => $orphans, + debug => 1, + nowrite => 1, + force => 1, + oktozap => 1, + rootfiles => 1, + salvagedirs => 1, + blockreads => 1, + ListResidencies => 1, + SalvageRemote => 1, + SalvageArchival => 1, + IgnoreCheck => 1, + ForceOnLine => 1, + UseRootDirACL => 1, + TraceBadLinkCounts => 1, + DontAskFS => 1, + LogLevel => $loglevel, + rxdebug => 1, + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 setauth @@ -972,20 +955,21 @@ The bos help string is: bos setauth: set authentication required flag Usage: bos setauth -server - -authrequired - [-cell ] [-noauth] [-localauth] + -authrequired + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->setauth( + my $result = $bos->setauth + ( # Required arguments - server => $server, - authrequired => $authrequired, + server => $server, + authrequired => $authrequired, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 setcellname @@ -993,19 +977,20 @@ The bos help string is: bos setcellname: set cell name Usage: bos setcellname -server -name - [-cell ] [-noauth] [-localauth] + [-cell ] [-noauth] [-localauth] The corresponding method invocation looks like: - my $result = $bos->setcellname( + my $result = $bos->setcellname + ( # Required arguments - server => $server, - name => $name, + server => $server, + name => $name, # Optional arguments - cell => $cell, - noauth => 1, - localauth => 1, - ); + cell => $cell, + noauth => 1, + localauth => 1, + ); =head2 setrestart @@ -1013,42 +998,25 @@ The bos help string is: bos setrestart: set restart times Usage: bos setrestart -server -time