AFS::CM - Module to administer the AFS Cache Manager
use AFS::CM qw ( checkconn checkservers checkvolumes cm_access flush flushcb flushvolume getcacheparms getcellstatus getcrypt getvolstats setcrypt setcachesize setcellstatus ); my $ok = flushvolume('.'); print "Return Code = $ok\n"; $ok = checkvolumes; print "Return Code = $ok\n"; $ok = cm_access($path); print "Return Code = $ok\n"; ($max, $inuse) = getcacheparms; $ok = setcachesize(10000); my $crypt_flg = getcrypt; $ok = setcrypt('on');
This module provides several functions to administer the AFS Cache Manager. It is used to customize the cache size. You can force the update of cached data. And you can determine if a client machine can run SETUID programs. Any function required must by explicitly listed by the use statement to be exported into the calling package.
use
Some of these functions have the optional argument FOLLOW. FOLLOW determines which file should be used should PATH be a symbolic link. If FOLLOW be set to 1, then the symbolic link is followed to its target. If FOLLOW is set to 0, then the function applies to the symbolic link itself. If not specified FOLLOW defaults to 1.
This release does NOT support any features and interfaces from version 1.
none
The following functions will be exported into your namespace if you specifically ask that they be imported.
Checks the status of all the callers tokens held by the Cache Manager. Returns success if the caller has tokens, and all those tokens are valid (i.e, not expired).
Forces the Cache Manager to update volume-related information.
Returns 1 if caller has access with the given permissions PERMS (default 'read') to given PATH.
Forces the Cache Manager to discard PATH.
Forces the Cache Manager to flush only the callback for PATH.
Forces the Cache Manager to discard all cached data from the volume containing PATH.
Returns the current size of the cache and the amount being used.
Determines whether the local Cache Manager allows SETUID programs to run or not. Returns 1 if SETUID programs are allowed for given CELL (default local).
Gets the Cache Manager encryption flag. This function is supported only under OpenAFS.
Returns information about the volume containing PATH. The return value is a reference to a hash table containing the values from the C structure VolumeStatus. The hash values can be up to five minutes old, because the Cache Manager polls the File Server for partition information at that frequency. The hash table has the following keys
VolumeStatus
Blessed BlocksInUse InService MaxQuota MinQuota Motd Name NeedsSalvage OffMsg Online ParentId PartBlocksAvail PartMaxBlocks Type Vid
You can find an example how to print the entire content of the returned hash reference in the examples/v2/cm directory.
examples/v2/cm
Sets the size of the disk cache. NUM is size in 1K byte blocks
Enables or disables the local Cache Manager to run SETUID programs for the given CELL (default local).
Set the Cache Manager encryption flag to FLAG. Valid values are 'on' or 'off'. This function is supported only under OpenAFS.
Norbert E. Gruener <nog@MPA-Garching.MPG.de>
Roland Schemers <schemers@slapshot.stanford.edu>
Copyright (c) 2001-2010 Norbert E. Gruener <nog@MPA-Garching.MPG.de>. All rights reserved. Copyright (c) 1994 Board of Trustees, Leland Stanford Jr. University. All rights reserved.
Most of the explanations in this document are taken from the original AFS documentation.
AFS-3 Programmer's Reference: File Server/Cache Manager Interface Edward R. Zayas Copyright (c) 1991 Transarc Corporation. All rights reserved. IBM AFS Administration Reference Copyright (c) IBM Corporation 2000. All rights reserved.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Copyright (c) 1994 Board of Trustees, Leland Stanford Jr. University
Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by Stanford University. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Revision $Rev: 1059 $
To install AFS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AFS
CPAN shell
perl -MCPAN -e shell install AFS
For more information on module installation, please visit the detailed CPAN module installation guide.