⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfa.tr

📁 ftam等标准协议服务器和客户端的源代码。
💻 TR
📖 第 1 页 / 共 2 页
字号:
The \fBsetrequest\fP command is usedto set the transfer mode of the local version of the file(s) provided asargument(s) to REQUEST mode. 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..NH 2setauto.XSsetauto.XE.LPThe \fBsetauto\fP command is used toset the transfer mode of the local version of the file(s) provided asargument(s) to AUTOMATIC mode. 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..NH 2getfile.XSgetfile.XE.LPThe \fBgetfile\fP command is used torequest the transfer of the shared file(s) provided as argument(s). Ifthe name of the file is a symbolic link, the file referenced by the linkis target of the operation if it is located within the sharedsubtree..LPIf the remote version of the file is in MASTER status, a localSLAVE version is created if the file does locally not exist. If a localSLAVE version already exists, it is updated from the remote MASTERversion..LPIf the remote version of the file is in UNREGISTERED status, alocal version of the file with status UNREGISTERED is created if thefile does locally not exist. If a local  version already exists, it isupdated from the remote version..LPThe transfer of the file is performed according the version-time(time of last modification) of the local and remote files. If both theversion-times of both files are equal, no transfer has to be performedbecause the SLAVE version is already up-to-date. If the version-time ofthe remote MASTER is older that the version-time of the local SLAVE (orUNREGISTERED) version, an inconsistency has been detected and an erroris reported. Otherwise, the content of the file has to be transmitted toupdate the local SLAVE (or UNREGISTERED) version of the file..LPThe content of the file can be transferred either in uncompressedor in compressed mode, depending on the size of the file. The size limitwhen compression shall occur can be configured as described inchapter 5. The compression and decompression is done usingthe UNIX(TM) \fBcompress(1)\fP and\fBuncompress(1)\fP commands..LPOptionally, the old version of the local file will be saved in as afile with the suffix \fB.bak\fP if thelocal file is updated. This option can be configured as described inchapter 5..NH 2syncdir.XSsyncdir.XE.LPThe \fBsyncdir\fP command is used tosynchronize the files within the directory/ies provided as argument(s)with their counterparts at the remote site. Here the basic principle is,that the site executing the \fBsyncdir\fPcommand is only synchronizing the local site by applying the followingactions to the list of files that exists at the\fIremote\fP site within the givendirectory:.ds is \(bu.RS.IP \*(is 3Create a local SLAVE file versions for newly found remote MASTERversion file. This is done according to the transfer mode of the file.If the transfer mode is set to REQUEST, only a dummy SLAVE version offile is created which indicates the existence of the file, but does nothave its actual content. Otherwise, the content of the file istransferred as described with the\fBgetfile\fP command..IP \*(is 3Update local SLAVE file version with a remote MASTER version ifthe transfer mode of the file is AUTOMATIC.IP \*(is 3Create local SLAVE sub-directory if a new MASTER sub-directory hasbeen found at the remote site. By this, the shared subtree will grow insize. Directories found at the remote site that are in statusUNREGISTERED are \fINOT\fP createdlocally..IP \*(is 3Create a local symbolic link if a symbolic link has been found atthe remote site. This is only done if the file referenced by the link islocated within the shared subtree..IP \*(is 3Perform various checks to insure consistency between local andremote sites views of the files within the directory..IP \*(is 3Removes local SLAVE files if there is no corresponding MASTER fileat the remote site. If there is a UNREGISTERED file at remote, the localfile state is set to UNREGISTERED..IP \*(is 3Execute a existing \fB.rfaexec\fPfile if any file within the directory has been updated and the directoryitself in not LOCKED..RE.LPTo achieve a fully synchronized directory, both sites need toperform a \fBsyncdir\fP operation for thatdirectory at periodic times. This will be typically done by creating anentry into the systems \fBcrontab\fP..NH 2rsyncdir.XSrsyncdir.XE.LPThe \fBrsyncdir\fP command is verysimilar to the \fBsyncdir\fP command, butperforms a recursive synchronization of the whole subtree starting atthe directory/ies provided as argument(s). The same actions areperformed as within the \fBsyncdir\fPcommand with an additional actions:.LP.ds is \(bu.RS.IP \*(is 3If a MASTER directory is detected at the remote site and thetransfer mode of this directory is set to AUTOMATIC, the directory issynchronized recursively.   .IP \*(is 3It does not follow symbolic links pointing to directories.RE.LPDirectories found at the remote site that are in statusUNREGISTERED or don't have transfer mode AUTOMATIC are\fINOT\fP synchronized recursively. They haveto be updated individually by applying the\fBsyncdir\fP command..LPUsing the \fBrsyncdir\fP command it ispossible to synchronize the whole shared subtree. The configurationwhich parts of a subtree at a site belongs to that shared subtree isdone by setting the MASTER status and the transfer level of the filesand directories appropriately..NH 2timesync.XStimesync.XE.LPTo synchronize the local clocks of the participating sites, the\fBtimesync\fP command can be used. Thiscommand synchronizes the local clock of the site acting as the\fBtime slave\fP with the clock of the\fBtime master\fP site. The command can becalled at both sites to initiate the synchronization. The configurationof a site to be \fBtime slave\fP or\fBtime master\fP is described in chapter5.NH 2help.XShelp.XE.LPThe \fBhelp\fP command shows the listof available command and gives a one-line description of eachcommand..NH 2quit.XSquit.XE.LPObviously, the \fBquit\fP commandsterminates the \fBrfa\fP session..NHThe RFA-EXEC facility.XSThe RFA-EXEC facility.XE.LPWhen a directory within the shared subtree is synchronized usingthe RFA \fBsync\fP or\fBrsync\fP commands, in most cases thereare further actions required if any files have been updated, e.g.issuing a \fBmake\fP command to re-buildthe updated software. This can be achieved by RFA's facility to create afile called \fB.rfaexec\fP in eachdirectory. This file is executed by\fBsh(1)\fP every time the directory issynchronized and minimally one file within the directory has beenupdated. The file \fB.rfaexec\fP can behave executable format (sh, csh, binary) and should have the executedpermission set. When RFA executed this file, it passes the names of thefiles that have been updated as arguments to it..LPThis facility can be disabled by setting the\fBrfaexec\fP tailoring option to\fBoff\fP. Further, it can be disabled fora single directory by setting the LOCKED status of the directory. Thisis useful to prevent re-compilations of software during an unfinisheddevelopment cycle. .LPFor security reasons, the\fB.rfaexec\fP file can\fINOT\fP be registered as MASTER or SLAVEfile. An automatic transfer of this file may cause a user to executesomething during the \fBsync\fP commandwhich has been "imported" from the remote site. Therefore,the \fB.rfaexec\fP file is always a localunregistered file..NHRFA Configuration.XSRFA Configuration.XE.LPThe configuration of the RFA client(\fBrfa\fP)  and the RFA server(\fBros.rfa)\fP server can be tailored atstart time by a configuration file. This file is called\fBrfatailor\fP and can exist either in theISODE's $(ETCDIR) or the RFA specific tailoring directory which isdefined in the \fBconfig.h\fP file of RFAas \fBRFA_TAILDIR\fP. This file is read byboth the RFA client and server. The file consists of a number oftailoring statements with the syntaxtailoringOption     =    tailoringValue .LPLines with comments start with a "#". .LPThe options that are valid for both the RFA client and serverare:.IP "root" 15the pathname of the root of the shared subtree at the localsite.IP "time" 15the role that the local site plays for time synchronization.Possible values are \fBmaster\fP or\fBslave\fP..LPThe following options are only recognized by the RFA server:.IP "compress" 15The limit for the filesize in bytes when compression duringthe transfer operation shall occur..IP "chmod" 15determines if the write permissions of local SLAVE filesshall be removed and write permissions to local MASTER and UNREGISTEREDversions shall be set. This requires that user executing the\fBrfa\fP command is the owner of the fileor the \fBrfa\fP program runs under theeffective user id of root. Possible values are\fBon\fP and\fBoff\fP..IP "debuglog" 15enables more detailed logging information to be written tothe RFA logfile \fBrfa.log\fP in the ISODElogdir. Possible values are \fBon\fP and\fBoff\fP.  .LPThe following options are only recognized by the RFA client. Theymay additionally be defined on a per-user basis in a file called\fB.rfarc\fP in the users homedirectory..IP "host" 15the name of the remote host. This name must be defined inthe ISODE's \fBisoentities\fPdatabase..IP "user" 15the username that shall be used to authenticate with theremote RFA server. This must be a UNIX(TM) login name that is validon the remote site..IP "password" 15The password corresponding to the user name. This passwordmust be the password for the given login name at the remotesite..IP "backup" 15determines if a backup file with suffix\fB.bak\fP shall be created when a localfile is updated. Possible values are\fBon\fP and\fBoff\fP..IP "chgrp" 15determines if the group-id of local SLAVE files shall be setaccording to the group-id of the remote MASTER file. This requires thatuser executing the \fBrfa\fP command ismember of all groups that may appear or the\fBrfa\fP program runs under the effectiveuser id of root. Possible values are\fBon\fP and\fBoff\fP..IP "chown" 15determines if the user-id of local SLAVE files shall be setaccording to the user-id of the remote MASTER file. This requires thatuser executing the \fBrfa\fP command is theowner of the file or the \fBrfa\fP programruns under the effective user id of root. Possible values are\fBon\fP and\fBoff\fP..IP "transfer" 15the default transfer mode that is set when a file isregistered the first time. Possible values are\fBauto\fP and\fBrequest\fP.IP "clearsuid" 15determines if the set-uid-on-execution bit of files iscleared if they are transferred to the remote site.  Possible values are\fBon\fP and\fBoff\fP. If RFA runs with effectiveuser-id of root and \fBchown\fP options isenabled, \fBclearsuid\fP should be enabledto avoid that privileged users from one sites are able to gain illegalprivileges at the other site..IP "rmslaves" 15determines if slave files with no remote master file aredeleted during the \fBsync\fP and\fBrsync\fP command. Possible values are\fBon\fP and\fBoff\fP. If a there is a remoteUNREGISTERED file, the status of the local SLAVE file is only changed toUNREGISTERED. .IP "rfaexec" 15determines if the\fB.rfaexec\fP files are executed during a\fBsync\fP or\fBrsync\fP command. Possible values are\fBon\fP and\fBoff\fP. .NHSome Words on User-IDs and Permissions.XSSome Words on User-IDs and Permissions.XE.LPIn principle, the RFA client runs with the user-id of the user thatinvokes the client. The RFA server either runs with the user-id of theuser who owns the server program (as performed by\fBtsapd(8)\fP), or it runs with theuser-id the invoker has supplied with the bind arguments (a username andpassword valid at the remote server host). In the later case\fBtsapd\fP needs to run with user-id ofroot and ros.rfa needs to be owned by root..LPUnder certain circumstances, RFA client and server need to domodification to files which are not owned by the user-id that RFA isrunning with, such as.ds is \(bu.RS.IP \*(is 3changing a files access right (e.g. if it becomes a slaveversion).IP \*(is 3changing a files owner of group (e.g. if a local slave is updatesaccording to a remote master and the\fBchown\fP and\fBchmod\fP options are enabled.RE.LPOne way to deal with these problems is to disable these facilitiesof RFA by setting the \fBchown\fP,\fBchgrp\fP and\fBchmod\fP options to\fBoff\fP. This will be suitable in anenvironment where all files within the shared subtree belong to a singleuser and only this user runs RFA client and server processes..LPOtherwise, if different users access the files, minimally the\fBchmod\fP option should be enabled toavoid modifications to slave files (remember that locking in rfa isadvisory) by making slave files read-only. Further, the\fBchown\fP and\fBchgrp\fP options should be enabled ifthe users and groups are the same at both sites to maintain theownership (and originatorship of modification) across the two sites..LPThis can be achieved by running the RFA client and server with theeffective user-id of root (by setting the set-uid-on-execution flag).The RFA client will set his effective user-id during start-up to hisreal user-id and switches back to the effective user-id of root only forthese sections of code where the root permissions are really required tochange the access mode, owner or group of files. Otherwise, the RFAclient run with the effective user-id equal to his real user-id..LPThe RFA server changes his effective user-id during start-up to theuser-id provided by the calling client. Like the RFA client, it switchesback to the effective user-id of root only for these sections of codewhere the root permissions are really required to change the access modeof a file..LPIf the RFA client and server do not run with effective user-id ofroot, the time synchronization command of RFA can only be used, if theexternal program \fBrfatime\fP of the RFApackage is installed to run with set-uid root.NHWhat is still missing ....XSWhat is still missing ....XE.LPThe current version of RFA is a first shot which needs somecompletion and extensions..ds is \(bu.RS.IP \*(is 3A command like "remote-diff" could be helpful forresolving inconsistencies..IP \*(is 3The time synchronization only works if the local time of a\fBtime-slave\fP site can be modified,which may not hold true in each environment..IP \*(is 3There is a problem with the\fBchown\fP,\fBchgrp\fP and\fBchmod\fP facilities of RFA because theenabling of them may cause "permission denied" errors if theRFA does not run with the effective used id of root..IP \*(is 3RFA is only capable to support distribution over two sites, whichshould be extended to allow a multiple site configuration. This mayrequire the redesign of the RFA model and will introduce a new level ofcomplexity..RE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -