SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Unwrap page!
Comp. Search
Who's who?
Meetings
FAQ Homepage
Archive
Environment
Administration
New User Info.
Web Info/Tools
Monitoring
Training
Tools & Utils
Programming
C++ Standard
SRT, AFS, CVS
QA and QC
Remedy
Histogramming
Operations
PromptReco
Simulation Production
Online SW
Dataflow
Detector Control
Evt Processing
Run Control
Calibration
Databases
Offline
Workbook
Coding Standards
Simulation
Reconstruction
Prompt Reco.
BaBar Grid
Data Distribution
Beta & BetaTools
Kanga & Root
Analysis Tools
RooFit Toolkit
Data Management
Data Quality
Event display
Event Browser
Code releases
Databases
Check this page for HTML 4.01 Transitional compliance with the
W3C Validator
(More checks...)

BABAR Login Scripts

11 Feb 1997
revision history: 6/2/97, 5/5/98, 6/9/98, 6/29/98

[ BABARHome || ComputingHome | ToolsHome]


Using the HEPiX Scripts

  • If you would like a brief background on shells and the HEPiX scripts, read the Background Section.
  • If you are a new user and wish to set up your environment for BABAR, read the section for new users.
  • If you are an existing C-shell (or tcsh) user and wish to convert your SLAC Unix account to use the HEPiX scripts, read the section for C-shell users.
  • If you are an existing Bourne-shell (or Korn shell) user and wish to convert your SLAC Unix account to use the HEPiX scripts, read section Bourne-shell users.
  • Exceptional cases in which you may need to modify your .cshrc to that the HEPiX scripts do the right thing.
  • Reference information with locations of specific files is given in the last section.
  • Background

    Whenever you log onto a Unix machine, one or more processes are started. For interactive sessions, this process is typically a "shell", e.g. csh, tcsh, bash, etc. An example of a non-interactive process is the execution of a remote command, e.g. "rsh vesta date", although even in this case a shell is created within which to run the "date" command.

    When a shell is started, a user start-up script is run to customize your environment. In the case of C-shell (csh), for example, that script is $HOME/.cshrc (where $HOME is your home directory). The .cshrc file is intended to set environment variables, define aliases, and whatever other steps are needed. A special case is a "login shell" which is identical to an ordinary shell except that, in the case of the C-shell, a second start-up script called $HOME/.login is run after the $HOME/.cshrc. It is intended that the .login script perform terminal-specific actions, such as setting keyboard mappings.

    The HEPiX group has created a set of login scripts to make the appearance of logging in and the method of customization appear standard from site to site and across multiple Unix architectures. Customizations prepared in this way, e.g. the BABAR environment, should be reasonably portable from site to site. There are six levels of script in this system (executed in order):

    HEP
    HEP-wide customizations
    site
    Site-wide customizations (e.g. SLAC or CERN)
    system
    A particular type of system (e.g. architecture)
    cluster
    A particular defined group of machines
    group
    A particular defined group of users (e.g. BABAR)
    user
    Individual user customizations
    SLAC has adopted the strategy of moving away from the "environ" script which many users have in their .cshrc files, to the HEPiX environment. Ideally, you need only replace a single line into your .cshrc and insert a new line into .login to make this conversion. In practice, you are likely to have accumulated lines in your .cshrc and .login that are no longer needed (such as BABAR group related customizations or some terminal setup actions); these items should be removed to prevent confusion and to speed up your login.

    New users

    We recommend that new users at SLAC plan to use the tcsh (TC-Shell). After obtaining a new account, the following steps may be used to arrive at a convenient BABAR-compatible environment.
    1. Make tcsh your default login shell (this should be the default if you have a new account, otherwise, you must send email to unix-admin@slac.stanford.edu with this request).
    2. Copy the template login files to your home directory (remove any pre-existing .cshrc, .login, .kshrc files first)
      cp /afs/slac/g/babar/etc/hepix/Newuser/cshrc $HOME/.cshrc
      cp /afs/slac/g/babar/etc/hepix/Newuser/login $HOME/.login
            
      
    3. Edit the templates to suit your needs. There are a number of commented-out lines that may be reactivated with your choice, for example, of a nearby printer.
    4. Create the directory $HOME/.hepix and copy a small file identifying "babar" as the preferred group. This will cause the BABAR-specific environment to be established.
      mkdir $HOME/.hepix
      cp /afs/slac/g/babar/etc/hepix/Newuser/preferred-group $HOME/.hepix
             
      
    5. To test the new system, DO NOT LOGOUT! From your current shell, telnet to any SLAC machine. If something fails, you will have your original shell still running to make corrections.

    Existing C-shell (and tcsh) users

    Note: $HOME refers to your home directory (default directory with you login)

    To convert your login to a HEPiX-style login do the following steps.

    1. Copy your $HOME/.cshrc just in case something screws up:
      cd $HOME
      cp .cshrc original.cshrc
      
    2. Create the directory $HOME/.hepix and copy a small file identifying "babar" as the preferred group. This will cause the BABAR-specific environment to be established.
      mkdir $HOME/.hepix
      cp /afs/slac/g/babar/etc/hepix/Newuser/preferred-group $HOME/.hepix
             
      
    3. Add the following lines at or near the beginning of your $HOME/.cshrc file:
      if ( -r /usr/local/lib/hepix/central_env.csh ) then
        source /usr/local/lib/hepix/central_env.csh
      endif
      
      Note there is a somewhat longer version of this code in the template described in the New users section above. The only difference is how oddball platforms (e.g. SGI, Linux, NeXT) are handled; in particular, if the HEPiX scripts do not exist for a particular platform, an attempt is made to execute the BABAR group script.
    4. If you currently call the BABAR login scripts in your $HOME/.cshrc, remove them as they are no longer needed and the old scripts are obsolete and will not be maintained. This code may look like any of the following lines (other variations are possible):
      source /nfs/juno/u5/etc/profile/.babar_environ
      source /afs/slac.stanford.edu/g/babar/etc/profile/.babar_environ
      source $BFPROFILE/.babar_slac
      source /nfs/juno/u5/etc/profile/.bfcshrc
      source /afs/slac.stanford.edu/g/babar/etc/profile/.bfcshrc
      
    5. If you currently call the SLAC "environ" script, remove it as it is superceded by the HEPiX scripts and will, eventually, become obsolete and unsupported. This line may look like this:
      eval `/usr/local/bin/environ /bin/tcsh -i${?prompt} motif -e emacs:vi`
      
    6. Look through your.cshrc file for other BABAR-related items, such as defining environmental variables ("setenv BF...") or setting up the SRT system,
      source $BFROOT/dist/releases/current/SoftRelTools/SRTstartup.csh
      
      In most cases, all of this stuff may be safely discarded. If you do not know if you need this or not, it is probably safe to discard it, otherwise keep it.
    7. Add the following code at or near the beginning of your $HOME/.login
      if ( -r /usr/local/lib/hepix/central_login.csh ) then
        source /usr/local/lib/hepix/central_login.csh
      endif
      
    8. If you currently call the BABAR login script from your $HOME/.login, remove them as they are now obsolete. The code will look similar to the that in step 2. above, but with names like ".bflogin"
    9. (recommended only) Remove any pre-existing ~/.kshrc file you may have.
    10. To test the new system, DO NOT LOGOUT! From your current shell, telnet to any SLAC machine. If something fails, you will have your original shell still running to make corrections.

    Existing Bourne-shell (and bash/korn/zsh) users

    Note: Previously there has been no BABAR environment support for these shells. Beginning now, we plan to support a Bourne shell version of the BABAR group login setup scripts.

    To convert your login to a HEPiX-style login do the following steps.

    1. Backup your $HOME/.profile file and any other configuration file your shell may use just in case something screws up:
      cd $HOME
      cp .profile original.profile
      
    2. If your shell has a resource dot file, (e.g. $HOME/.bashrc), add the following lines at or near the beginning of it:
      if [ -r /usr/local/lib/hepix/central_env.sh ]; then
        . /usr/local/lib/hepix/central_env.sh
      fi
      
    3. If you currently source any BABAR login scripts in your resource files or any Bourne shell equivalents you created, remove them as they are no longer needed and the old scripts are obsolete and will not be maintained. These scripts define BABAR specific environment variables ("setenv BF..."), set up the SRT system and add BABAR binary directories to your PATH. Example:
      source $BFROOT/dist/releases/current/SoftRelTools/SRTstartup.sh
      
    4. If you currently call the SLAC "environ" script, remove it as it is superceded by the HEPiX scripts and will, eventually, become obsolete and unsupported. This line may look like this:
      eval `/usr/local/bin/environ /bin/ksh -i${?prompt} motif -e emacs:vi`
      
    5. Add the following code at or near the beginning of your $HOME/.profile
      if [ -r /usr/local/lib/hepix/central_login.sh ]; then
        . /usr/local/lib/hepix/central_login.sh
      fi
      
    6. Create the directory $HOME/.hepix and copy a small file identifying "babar" as the preferred group. This will cause the BABAR-specific environment to be established.
      mkdir $HOME/.hepix
      cp /afs/slac/g/babar/etc/hepix/Newuser/preferred-group $HOME/.hepix
             
      
    7. To test the new system, DO NOT LOGOUT! From your current shell, telnet to any SLAC machine. If something fails, you will have your original shell still running to make corrections.

    Exceptional Cases

    There are times when the standard recipe above will not work. Below are a few special cases and suggestions for how to deal with them (as they are made known to the author).

    Overriding $BFARCH
    Temporary "transitional" architecture names were used in the past during the change from using gcc to the vendor C++ compiler. We needed distinct locations for libraries and binaries created by different compilers as they were not interchangable, hence the designation "HPUX9-native", etc. It likely we will need to use this mechanism again in the future, e.g. as we migrate to new versions of compilers.
    Another need arises when an underlying architecture changes (e.g. an OS upgrade), but old libraries and executables continue to function. For example, OSF1v3 binaries continued to work even if your machine had been upgraded to OSF1v4. When this happens, the normal mechanism for setting BFARCH will attempt to use the new architecture designation - even if there is no release for it.
    The suggested way to deal with both situations is to define the value of BFARCH in your .cshrc script before calling the HEPiX scripts. For example, (in C-shell for a SLAC user):

    set flavor = `/afs/slac/g/babar/etc/hepix/flavor`
    switch($flavor )
    #                   Point to native AIX compiler
     case *_AIX-4*:
        setenv BFARCH AIX4-native
     breaksw
    #                   Let DUX4 pretend to be DUX3
     case *_OSF-4*:
        setenv BFARCH OSF1V3-native
     breaksw
    endsw
    
    
    Note the use of the flavor script. This script is maintained at SLAC within the UserLogin CVS module.

    Reference

    The HEPiX script system at SLAC is located in /usr/local/lib/hepix. The BABAR-specific group scripts are located in $BFROOT/etc/hepix and the new user templates in $BFROOT/etc/hepix/Newuser. The group scripts are also maintained in CVS as module "UserLogin", upon commit reference copies of all files are automatically written to $BFROOT/etc/hepix. Additional information on how the HEPiX scripts work may be found by reading the comments in the scripts; a short outline of the script hierarchy and what scripts get called in what order for C-shell users is located in the UserLogin module as file HEPiXinfo.txt.
    ($Id: HEPiX.html,v 1.13 1998/06/29 19:53:00 dragon Exp $)

    This page is maintained by Tom Glanzman