NAME

LCFG::Component::OpenAFS::Helper - Hacky replacement for AFS::BOS

VERSION

This documentation refers to LCFG::Component::OpenAFS::Helper version 0.0.34

SYNOPSIS

use LCFG::Component::OpenAFS::Helper;

my $bos = LCFG::Component::OpenAFS::Helper->new("server");

my ( $cell, $hosts ) = $bos->listhosts();

my ( $general_restart, $binary_restart ) = $bos->getrestart();

DESCRIPTION

This class is a hacky stand-in for when the AFS::BOS module is not available. You really should be using AFS::BOS if at all possible but sadly it currently does not build on x86_64 based platforms.

This class provides a small subset of the methods which are available in AFS::BOS. They are purely there to make the openafs component work on x86_64 platforms. This module might be useful elsewhere but note that by design it is meant to be limited in scope. Rather than doing everything through a Perl XS layer this module just builds bos shell commands which are then executed and the output is parsed.

SUBROUTINES/METHODS

For full information see the AFS::BOS documentation.

new(SERVER, [NOAUTH], [LOCALAUTH], [CELL], [ENCRYPT])

Creates a new object which can be used to communicate with the bos server. If no SERVER is defined then it defaults to "localhost", NOAUTH defaults to false, LOCALAUTH defaults to false, CELL defaults to undef, ENCRYPT is ignored.

($cell, $hosts) = $bos->listhosts

Returns the cell name and a reference to the list of database server machines.

$ok = $bos->addhost(HOST)

Takes a scalar or a reference to a list of hosts and adds them to the local CellServDB file.

$ok = $bos->removehost(HOST)

Takes a scalar or a reference to a list of hosts and removes them from the local CellServDB file.

@users = $bos->listusers

Returns an array containing a list of the privileged users from the local "UserList" file.

$ok = $bos->adduser(USER)

Takes a scalar or a reference to a list of users and adds them to the list of privileged users stored in the UserList file.

$ok = $bos->removeuser(USER)

Takes a scalar or a reference to a list of users and removes them from the list of privileged users stored in the UserList file.

($gtime, $btime) = $bos->getrestart

Returns the restart times GTIME and BTIME from the local "BosConfig" file. GTIME is the general restart time at which the BOS Server process automatically restarts itself. BTIME is the binary restart time at which the BOS Server automatically restarts any process for which the time stamp on the binary file in the local "/usr/afs/bin" directory is later than the last restart time for the process.

$ok = $bos->setrestart(TIME,GENERAL,NEWBINARY)

Sets the restart TIME at which the BOS Server restarts processes. Set GENERAL to 1 (default 0) to set the restart time of the BOS Server to TIME. This TIME is once per week. Set NEWBINARY to 1 (default 0) to set the binary restart time. The TIME is once per day. Only one of the arguments GENERAL and NEWBINARY can be set.

$status = $bos->status(LONG,[INSTANCE])

Returns the STATUS of either all server processes listed in the local "BosConfig" file or the process INSTANCE. INSTANCE is either a scalar value or a reference to an array of process names. STATUS is a hash reference containing the current process status. Set LONG to 1 (default 0) to get extended information about the process status.

$ok = $bos->stop(INSTANCE,[WAIT])

Sets the status flag for each INSTANCE process to NotRun in the local "BosConfig" file on the server machine, then stops it. INSTANCE is either a scalar value or a reference to an array of process names. Set WAIT to 1 (default 0) to delay the program flow until all processes actually stop. Otherwise the method returns almost immediately even if all processes are not stopped.

$ok = $bos->start(INSTANCE)

Sets the status flag for each INSTANCE process to Run in the local "BosConfig" file and in the BOS Server’s memory on the server machine, then starts it. If the INSTANCE process is already running, the only effect is to guarantee that the status flag is Run; it does not restart the process. INSTANCE is either a scalar value or a reference to an array of process names.

$ok = $bos->delete(INSTANCE)

Deletes the entry INSTANCE from the local "BosConfig" file. INSTANCE is either a scalar value or a reference to an array of instance names.

$ok = $bos->create(INSTANCE,TYPE,COMMAND)

Creates a server INSTANCE entry in the local "BosConfig" file on the server machine, sets the process’s status to Run in the "BosConfig" file and in memory, and starts the process. TYPE specifies the process’s type. Acceptable values are: ’simple’, ’cron’, and ’fs’. COMMAND is either a scalar value or an array reference containing the commands the BOS Server should run to start the process.

$ok = $bos->setcellname(NAME)

Establishes the cell’s NAME and makes the server machine a member of it. And it records the NAME in the two local files "ThisCell" and "CellServDB".

DEPENDENCIES

This module requires IPC::Run and Date::Parse.

SEE ALSO

AFS(3), AFS::BOS(3), lcfg-openafs(8)

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

ScientificLinux5, Fedora12, Fedora13

BUGS AND LIMITATIONS

There are no known bugs in this application. Please report any problems to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

Copyright (C) 2010 University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 111:

Non-ASCII character seen before =encoding in 'Server’s'. Assuming UTF-8