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
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.
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.
- 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).
- 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
- 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.
- 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
- 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.
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.
- Copy your
$HOME/.cshrc just in case something screws up:
cd $HOME
cp .cshrc original.cshrc
- 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
- 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.
- 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
- 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`
- 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.
- 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
- 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"
- (recommended only) Remove any pre-existing ~/.kshrc file you may have.
- 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.
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.
- 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
- 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
- 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
- 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`
- 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
- 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
- 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.
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.
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
|