next up previous contents
Next: STAF Tutorial: Glossary Up: No Title Previous: STAF Tutorial: Realistic TPC

STAF Tutorial: CVS and AFS Commands

 

See the CVS and sl_* Commands Tutorial for descriptions and easy to follow instructions for creating packages, retrieving packages and adding or removing files within packages from CVS control.

The STAR Software Infrastructure group has developed a set of STAR Library scripts which carry out a number of useful CVS commands. These are typed at the normal UNIX prompt. It is recommended that beginners use these unless or until you become familiar with the actual CVS commands. Most STAR software developers use the "sl_*" commands.

IMPORTANT -- Before doing anything to a real STAR Library package (other than simply viewing it) you should contact the owner to coordinate efforts.

Briefly these commands are:

sl_create_pkg

Create a new STAR Library software package. With our present software management scheme under AFS, only the software branch managers are allowed to create new packages. The user must submit a Package Proposal Form to the branch manager. If approved, the manager will create the new package. The actual command is:

sl_create_pkg PKG BRA

where PKG is the TLA of the new package and BRA is the TLA of the branch, for example "sim".

sl_retrieve_pkg

Retrieve or check-out a STAR Library software package into a local directory. Note that there are several options, where -v is for viewing purposes only and -c allows you to check-in the package. You must be a member of the AFS group associated with this package and also a member of the "BRANCH_install" group in order to "check-in" a package. An example is:

sl_retrieve_pkg -v tfs

sl_add_file

This command adds files (and subdirectories) to the list of files that CVS will manage for this package. Note that issuing this command does not actually add any files to the CVS repository. The latter action is done with the sl_store_pkg command. Be careful to add all files that you intend to add before deleting anything. Also you can only add the filename to the CVS list once. If the file has been changed it does not need to be added to CVS again.

In general you should have CVS manage the documentation files in /doc, the inc and idl files in the /inc subdirectory, the source codes and PAM idl files in /src, any necessary setup and parameter kumac files in /wrk as well as an example run kumac. Please get advice from the package owner, branch manager or Staf expert before adding files to the CVS repository. Finally, never add binary files (no PKGStaf executables or libPKG.a files for example). CVS manages text files only. An example is:

sl_add_file foo_bottom.F

which you would type from the UNIX prompt in the foo/src directory.

sl_remove_file

This removes forever a file from CVS management. But remember that older versions of the CVS managed package will include this file. CVS remembers this past existence, hence you cannot add this same filename in this same directory at any later time. Note that this command does not affect the file in your local checked out copy of the package, nor does it cause the old filename to go away in the current version of the repository. The latter occurs when you check the package in using the sl_store_pkg command. An example is:

sl_remove_file dummy.idl

sl_store_pkg

This commits the package to the CVS repository. A cron job periodically updates the reference area of the STAR Library so your newly stored package will not show up in the $STAR_REF area for a while. If this update has not occurred by the next day please contact the branch manager or STAR Librarian (Lydia Didenko at BNL). This command is issued from the directory containing the checked out pkg. An example is:

sl_store_pkg foo

where, of course, you must check-in a real package that CVS knows about.

You are probably wondering about those binary files. To install these in the STAR Library change directory to /PKG and type

make install

Note that you must be a member of the AFS install group for the appropriate branch in order to do this. If you are not, please request the branch manager to add you to the AFS install group.

AFS Commands

From the user point of view AFS restricts access and grants privileges to STAR users. With a distributed computing environment these restrictions and control are necessary to prevent unauthorized access to STAR software. A complete description of the AFS and the groups is beyond the scope of this tutorial. Here I will only list a few of the more useful commands for the beginner. Please see the AFS tutorial web page at STAR Home Page > How To > STAR Library ACL > AFS Tutorial for a complete description.

pts mem groupname

List the members of an AFS group, for example:

pts mem star

will list all members of the STAR AFS group.

pts mem username

List the AFS groups to which username is a member of, example:

pts mem ray

pts chown groupname -owner new_owner_name

Change ownership of AFS group groupname to new_owner_name. For example:

pts chown smith:sl_bra_abc -owner jones

will change ownership from smith to jones.

pts listown username

List all AFS groups owned by username.

The access of users to the AFS groups (one AFS group is associated with each STAR Libary package) is recorded in an Access Control List (ACL). To list the groups which have access to a certain directory and what each group's privileges are type:

fs la /afs/rhic/star/... (explicit pathname)

where the privileges are denoted by r (read), l (lookup), i (insert), d (delete), w (write), k (lock) and a (administrative).

Use kpasswd to change your AFS password.

To see if you have read, write, etc. privileges in a certain AFS directory type:

als /afs/rhic/star/... (explicit pathname)

afsu is a convenient STAR Library tool written to facilitate STAR user access to AFS commands and access control information. To use this tool simply type:

afsu

which will present a list of options.

Always remember to "klog" before starting an AFS session and to "unlog" when you are finished to release your AFS token. To check to see if you have an AFS token type

tokens

at the UNIX prompt.

Many other commands are available for adding groups, members, changing ACLs and privileges, etc. but we will not go into these here. Please refer to the above AFS tutorial.



Lanny Ray
Tue Mar 10 11:27:44 EST 1998