📄 rfa.tr
字号:
.\".\" RFA - Remote File Access.\".\" rfa.tr : RFA User Manual (run through "roff -ms").\".\" Contributed by Oliver Wenzel, GMD Berlin, 1990.\".\".\" $Header: /xtel/isode/isode/others/rfa/RCS/rfa.tr,v 9.0 1992/06/16 12:47:25 isode Rel $.\".\" $Log: rfa.tr,v $.\" Revision 9.0 1992/06/16 12:47:25 isode.\" Release 8.0.\".\".AM.nr LL 7i.pl 11i.nr li 1 1.nr PD 50.TLRFA - Remote File Access.brA tool for managing access to files that are distributed at multiple sites.AUOliver WenzelGMD - FokusBerlin - Germany.brVersion 1.0.sp 4.NHIntroduction.XSIntroduction.XE.LPThis software tool called \fIRemote FileAccess\fP (RFA) has been designed to allow access to a setof files in a UNIX(TM) filesystem that are shared between multiplesites. It has been created within the VERDI 3 project as a result of ourown requirements for a distributed document and file management system.Basis for this requirements is the VERDI 3 project which members arelocated at two different sites. Both sites of the project share a commonset of documents and files which need to be accessed and modified duringthe everyday-project-work. For some time we used the FTAM software toexchange files between the two sites, but after the number of sharedfiles and transfer operations grew, very often questions like.ds is \(bu.RS.IP \*(is 3at which site the up-to-date (master) version of the file islocated ?.IP \*(is 3is the local version up-to-date ?.IP \*(is 3is anyone already editing this file ?.IP \*(is 3are there any newly created files ?.RE.LPappeared. Using a distributed filesystem like NFS was discussed asan alternative solution, but this did not seemed to be practicablebecause of the very slow communication links between the sites(9600Bps). Therefore, we tried to build a simple tool to handle thesesquestions. So the RFA tool was born and because the project is workingwith ISO protocols, we built the tool on top of the ISODE softwarepackage using the remote operation compiler\fBrosy(1)\fP. Currently the tools onlysupports to share files between two sites (because this was our primarygoal), but it should be possible to extend it to support multiplesites..NHThe Model.XSThe Model.XE.NH 2The Data Model.XSThe Data Model.XE.LPThe Data Model is based on the hierarchical structure of theUNIX(TM) filesystem. The RFA tools allows to share a subtree of thehierarchical filesystem structure between (currently) two sites. Thestructure of the shared subtree must be identical at both sites. Thelocal root of the shared subtree may be different at both sites. Subjectof the operation of the RFA tool are the files and directories withinthe shared subtree. .NH 3File Version-Time.XSFile Version-Time.XE.LPA file within a shared subtree exists at the different sites asdifferent (local) versions of the file. The version-time (state ofmodification) of a file version at a site is determined by the\fBmodification time\fP provided by theUNIX(TM) system call \fBstat(2)\fP. Todetermine which version of file is up-to-date, the youngest version-timeis chosen. This requires that the sites participating in the filesharing use synchronized clocks. This is necessary because themodification time is set automatically by the UNIX system using thelocal operating system clock. The RFA tool provides an operation tosynchronize the clocks where one of the sites is declared to be the\fBtime-master\fP which provides the timeto the \fBtime-slave\fP..NH 3RFA File Status.XSRFA File Status.XE.LPEach local version of a file that exists within the shared subtreeat a site has a RFA-specific status which is one of:.IP "MASTER" 15the file is the up-to-date version of the file andmodifications to the local version of the file are allowed..IP "SLAVE" 15the file is the read-only version of the file and may beup-to-date but it need not. For each local file with SLAVE status theremust be a MASTER version at the remote site. File version with SLAVEstatus will have file write permissions cleared..IP "UNREGISTERED" 15the file not shared and has only local significance. It maybe modified locally..LP.LPThis file status allows to determine which site has the up-to-dateversion of a file and is allowed to do modifications to the file. Thesite holding a SLAVE version of the file has to request the mastershipbefore it is allowed to do any modifications. Further, it has to beassured that the local version of the file at the new MASTER site isup-to-date. Otherwise the file has to be transferred first. A localversion of a file may change its status during its lifetime (e.g. fromUNREGISTERED to MASTER) as a result of several RFA operations describedlater..NH 3File Locking.XSFile Locking.XE.LPTo avoid that a file is modified by multiple users at the MASTERsite or that the mastership is transferred to the remote site while thelocal version is under modify-access by a local user, a local version ofa file can be (soft)-locked. Locking of files is only applicable to fileversions with status MASTER or UNREGISTERED..LPSetting the lock flag of a directory has the effect, that the\fB.rfaexec\fP file is not executed duringa RFA \fBsync\fP or\fBrsync\fP command. This can be used toenable the execution of the \fB.rfaexec\fPfile for a period of time (e.g. while doing incomplete modifications tothe source-code when \fB.rfaexec\fPcontains commands for re-compilation)..NH 3Transferlevel.XSTransferlevel.XE.LPOne mode of operation of the RFA tool is to synchronize sets oflocal version of files with the remote site. To determine if a file thatis mastered remote should be transferred during this synchronization, atransferlevel can be associated with each file:.IP "REQUEST" 15The file is not transferred automatically duringsynchronization. If a new MASTER file is detected at the remote site,only a local dummy (empty file) is created to indicate the existence ofthe file..IP "AUTOMATIC" 15The file is transferred automatically during synchronizationif the local version is not up-to-date. If a new MASTER file is detectedat the remote site, it is transferred..NH 2The Functional Model.XSThe Functional Model.XE.LPThe RFA tools is built using the\fBClient-Server\fP model of the ISODEremote operations environment. There is a RFA server (called\fBros.rfa)\fP at each site which isstarted dynamically by the ISODE\fBtsapd\fP. Most of the RFA commands areinterpreted by the RFA client (called\fBrfa\fP) which issues a remote operationto the remote RFA server. The RFA client does not perform a 1-to-1mapping of its commands onto the remote operations. It uses none, one ormore remote operations to execute a RFA command. The associationestablishment is done when the first remote operation is invoked. TheRFA client can operate in an interactive mode or a command mode..LPOne of the basic principles of RFA is that modifications to anyfiles are only performed locally by the RFA client. The remote RFAserver never modifies any file, so no remote file modifications arepossible. The ensure a certain autonomy of the two sites concerningmodifications of their local files..NHThe RFA Client.XSThe RFA Client.XE.LPThe RFA client (\fBrfa\fP) provides aninteractive mode and a command mode. The rfa command has the followingsyntax:.DS I 3rfa [ -u username -p password ] [ -h hostname] [ -q ] [ -c rfa-command ].DE.LPThe name of the host (as defined in the\fBisoentities\fP database) where theremote site is located can be specified using the\fB-h\fP option. Because the RFA clientbinds to the remote RFA server with a username that must be valid at theremote site, the \fB-u\fP and\fB-p\fP options can be used to specify theusername and the password for the remote site. The\fB-q\fP option directs\fBrfa\fP to run in quit-mode, where onlysevere errors are reported and no user interaction is performed. Usingthe \fB-c\fP option, a command can bepassed to rfa in command mode. This can be any command describedbelow..LPIf the rfa is called without the\fB-c\fP option, is runs in interactivemode. The \fBrfa\fP provides the followingcommands. A command can be abbreviated with its unambiguousprefix..NH 2pwd.XSpwd.XE.LPDuring interactive mode, \fBrfa\fP hasa current directory. This directory is relative to the root of theshared subtree. The \fBpwd\fP command showsthe name of the current working directory relative to the root of theshared subtree. Initially this is the current working directory of theUNIX \fBsh(1)\fP where\fBrfa\fP has been called if it is withinthe shared subtree. .NH 2cd.XScd.XE.LPThe \fBcd\fP command changes thecurrent directory of \fBrfa\fP ininteractive mode to the directory given as the first argument. No checkis made if this directory exists. It is not possible to change theworking directory above the root of the shared subtree..NH 2list.XSlist.XE.LPThe \fBlist\fP command provides alisting of the files within the directories given as the commandarguments. If no argument is given, the current working directory islisted. The output of the \fBlist\fPcommand is similar to the output of the UNIX \fBls-lg\fP command, e.g..DS I 3-rw-rw-r-- M-A ow verdi 754 Jul 12 13:59 .sunviewdrwxr-xr-x --- ow verdi 512 Jul 12 14:01 bin.DE.LPThe three character field after the file permissions is used toindicated the different rfa-specific states of the file. The firstcharacter indicates the status of the file, with M for master version, S for slave Version and- for unregistered version. The second character isthe lock indicator with an L indicating that thefile is currently locked and an - for unlocked. Thethird character indicates the transfer mode of the files withA for automatic transfer and - for transfer on request..NH 2rlist.XSrlist.XE.LPThe \fBrlist\fP command is similar tothe \fBlist\fP command with the differencethat the files in the directory at the remote site are listed..NH 2lock.XSlock.XE.LPThe \fBlock\fP command is used to geta locked local version of the file(s) that are provided as argument(s)to the command. Only regular files within the shared subtree are valid.It is not possible to lock directories, links, etc. . If the name of thefile to be locked is a symbolic link, the file referenced by the link islocked if it is located within the shared subtree..LPThe \fBlock\fP command should be usedwhenever a file within the shared subtree is modified to ensure that thelocal version of the file is a) the master version and b) not currentlyunder modify-access by another local user..LPIf the local version of the files has a SLAVE status, the lockcommand will try to get the mastership for the file. Therefore, it firstverifies that the local version is up-to-date, otherwise it transfersthe up-to-date version from the current master, similar to the\fBgetfile\fP command. After an up-to-datelocal version of the requested file exists, a\fBRequestMaster\fP operation is issued tothe remote site to transfer the mastership. If the file is not locked atthe remote site, the mastership is granted to the local site which thenis the new master. The local lock is set the by setting theL (ocked) flag in the local files state..LPIf the local version of the requested file already is the MASTERversion or is an UNREGISTERED file, it is checked if the file is alreadylocked by another local user, where the requested lock is rejected.Otherwise the local lock is set the by setting theL (ocked) flag in the local files state..LPBecause the lock command will be applied in the most cases to alocal version of the file that is already master, it is not necessary toexecute the whole \fBrfa\fP program to dothe local lock. Because the \fBrfa\fPprogram includes the whole code needed for the execution of the remoteoperations (ISODE stack, etc.), there may be a significant time delaywhile loading this huge program. To optimize this, a stand-alone programcalled \fBllock\fP is provided which isable to perform the locking if the local version is the master version.If \fBllock\fP could perform the locallock, it exits with exit-code 0. If the file is already lockedlocally or an error condition occurred it exits with exit-code 1. If thelocal version of the file is not MASTER, it returns 2 which indicatesthat the \fBrfa\fP command is needed toperform the locking..NH 2unlock.XSunlock.XE.LPThe \fBunlock\fP command is used torelease a lock for a local MASTER version of the file(s) provided ascommand argument(s). If the name of the file to be unlocked is asymbolic link, the file referenced by the link is unlocked if it islocated within the shared subtree. There is are no checks made if thefile has been locked by the user that performs the unlock operation..LPSimilar to the \fBllock\fP commandthere exists an \fBlunlock\fP command whichis capable to perform the release of the (always) local locks to avoidthe expensive use of the \fBrfa\fPcommand..NH 2master.XSmaster.XE.LPThe \fBmaster\fP command can be usedto request that the local version of the file(s) provided as argument(s)will become the MASTER version. If the name of the file is a symboliclink, the file referenced by the link is target of the operation if itis located within the shared subtree..LPIf the local version of the file is in UNREGISTERED status, itsstatus is set to MASTER if there is no version of the file with MASTERstatus at the remote site. This is the way how locally created fileswill be introduced into the set of shared files where the creating sitebecomes the initial master..LPIf the local version of the file is in SLAVE status, then themastership for the file is requested from the remote site similar to the\fBlock\fP command. The write accesspermissions of the new local MASTER version are set..NH 2slave.XSslave.XE.LPThe \fBslave\fP command can be used torequest that the local version of the file(s) provided as argument(s)will become a SLAVE version. If the name of the file is a symbolic link,the file referenced by the link is target of the operation if it islocated within the shared subtree..LPIf the local version of the file is in UNREGISTERED or MASTERstatus, its status is set to SLAVE if there is version of the file withMASTER status at the remote site. The write access permissions of thenew local SLAVE version are cleared..NH 2unregister.XSunregister.XE.LPThe \fBunregister\fP command can beused to request that the local version of the file(s) provided asargument(s) will become an UNREGISTERED version. If the local version ofthe file is locked, this results in an error. If the name of the file isa symbolic link, the file referenced by the link is target of theoperation if it is located within the shared subtree..NH 2setrequest.XSsetrequest.XE.LP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -