AFS-Command
view release on metacpan or search on metacpan
lib/AFS/Command/BOS.pod view on Meta::CPAN
(
# Required arguments
server => $server,
file => $file, # OR [ $file1, $file2, ... ]
# Optional arguments
dir => $dir,
cell => $cell,
noauth => 1,
localauth => 1,
);
=item Return Values
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 => [ 'bosserver', 'vlserver', 'ptserver' ],
cell => $cell,
) || die $bos->errors();
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:
B<AFS::Object::BosServer>
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
B<AFS::Object>
The following attributes should always be present:
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
=back
=head2 getlog
=over
=item Arguments
The bos help string is:
bos getlog: examine log file
Usage: bos getlog -server <machine name> -file <log file to examine>
[-cell <cell name>] [-noauth] [-localauth]
The corresponding method invocation looks like:
my $result = $bos->getlog
(
# Required arguments
server => $server,
file => $file,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
# Enhanced arguments
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().
If this argument is not specified, then the contents of the logfile
are stashed in an attribute of the returned object.
=item Return Values
This method returns an AFS::Object::BosServer object, which
contains one attribute.
my $result = $bos->getlog
(
server => $server,
file => "/usr/afs/logs/VolserLog",
redirect => "/var/tmp/VolserLog.$$",
) || die $bos->errors();
my $logfile = IO::File->new("</var/tmp/VolserLog.$$") ||
die "Unable to open logfile: $ERRNO\n";
while ( defined($_ = $logfile->getline()) ) {
....
}
# Alternately, the memory pig way:
my $result = $bos->getlog
(
server => $server,
file => "/usr/afs/logs/VolserLog",
);
foreach ( split(/\n+/,$result->log()) ) {
....
}
The object has the following attribute:
B<AFS::Object::BosServer>
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
contents of the requested logfile, as a single (potentially huge)
string.
NOTE: Since this method is usually invoked to retrieve one of the AFS
logfiles, which can be enormous on heavily loaded servers that have
not been restarted in a while, use of the redirect option is strongly
encouraged. If not used, the memory allocated to store the logfile
may be prohibitively large. Developer beware.
=back
=head2 getrestart
=over
=item Arguments
The bos help string is:
bos getrestart: get restart times
Usage: bos getrestart -server <machine name> [-cell <cell name>]
[-noauth] [-localauth]
The corresponding method invocation looks like:
my $result = $bos->getrestart
(
# 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 two attributes.
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<AFS::Object::BosServer>
Attributes Values
---------- ------
restart The server restart time
binaries The restart time when there are new, updated binaries
=back
=head2 listhosts
=over
=item Arguments
The bos help string is:
lib/AFS/Command/BOS.pod view on Meta::CPAN
kvno => $kvno, # OR [ $kvno1, $kvno2, ... ]
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
);
=head2 removeuser
The bos help string is:
bos removeuser: remove users from super-user list
Usage: bos removeuser -server <machine name> -user <user names>+
[-cell <cell name>] [-noauth] [-localauth]
The corresponding method invocation looks like:
my $result = $bos->removeuser
(
# Required arguments
server => $server,
user => $user, # OR [ $user1, $user2, ... ]
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
);
=head2 restart
The bos help string is:
bos restart: restart processes
Usage: bos restart -server <machine name> [-instance <instances>+] [-bosserver]
[-all] [-cell <cell name>] [-noauth] [-localauth]
Where: -bosserver restart bosserver
-all restart all processes
The corresponding method invocation looks like:
my $result = $bos->restart
(
# Required arguments
server => $server,
# Optional arguments
instance => $instance, # OR [ $inst1, $inst2, ... ]
bosserver => 1,
all => 1,
cell => $cell,
noauth => 1,
localauth => 1,
);
=head2 salvage
The bos help string is:
bos salvage: salvage partition or volumes
Usage: bos salvage -server <machine name> [-partition <salvage partition>]
[-volume <salvage volume number or volume name>]
[-file <salvage log output file>] [-all] [-showlog]
[-parallel <# of max parallel partition salvaging>]
[-tmpdir <directory to place tmp files>]
[-orphans <ignore | remove | attach>] [-debug] [-nowrite]
[-force] [-oktozap] [-rootfiles] [-salvagedirs] [-blockreads]
[-ListResidencies] [-SalvageRemote] [-SalvageArchival]
[-IgnoreCheck] [-ForceOnLine] [-UseRootDirACL]
[-TraceBadLinkCounts] [-DontAskFS] [-LogLevel <(MR-AFS) log level>]
[-rxdebug] [-cell <cell name>] [-noauth] [-localauth]
Where: -all salvage whole server
-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
(
# Required arguments
server => $server,
# Optional arguments
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
The bos help string is:
bos setauth: set authentication required flag
Usage: bos setauth -server <machine name>
-authrequired <on or off: authentication required for admin requests>
[-cell <cell name>] [-noauth] [-localauth]
The corresponding method invocation looks like:
my $result = $bos->setauth
(
# Required arguments
server => $server,
authrequired => $authrequired,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
);
=head2 setcellname
The bos help string is:
bos setcellname: set cell name
Usage: bos setcellname -server <machine name> -name <cell name>
[-cell <cell name>] [-noauth] [-localauth]
The corresponding method invocation looks like:
my $result = $bos->setcellname
(
# Required arguments
server => $server,
name => $name,
# Optional arguments
cell => $cell,
noauth => 1,
localauth => 1,
);
=head2 setrestart
The bos help string is:
bos setrestart: set restart times
Usage: bos setrestart -server <machine name> -time <time to restart server>
[-general] [-newbinary] [-cell <cell name>]
[-noauth] [-localauth]
Where: -general set general restart time
-newbinary set new binary restart time
( run in 0.530 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )