TN0089

FUE Login Methodology

CD/OSS
Applications Support


Background: the Fermi Files

Prior to ups/upd v4.x, the Fermi User Environment (FUE) was initialized by the Fermi Files, a suite of shell scripts copied to /usr/local/bin on each system. There were many difficulties with this methodology, including:

.login

 

     

/usr/local/etc/fermi .login

 

 set path

 

# lots

 

# of

 

# code (broken!)

 

# inside fermi.login

 

 

.cshrc

 

   

/usr/local/etc/fermi.cshrc

 

# lots

 

#of

 

# boken

 

# inside

 

# fermi.cshrc

 

 

Advantages of the New Methodology

When ups/upd were reimplemented in 1999, a new way of initialing FUE became possible. This new methodology eliminates many of the difficulties we've seen in the past:

The new methodology also has the aesthetic feature that, as with the coreFUE products themselves, users need to know only one piece of system-specific information: the SETUPS_DIR. Once you know how to initialize ups, you use setup to initialize everything else about the Fermi environment.

How to Initialize the FUE Environment

In the example below, we assume that the system contains the courtesy links /usr/local/etc/setups.[c]sh. If not, substitute the correct path to $SETUPS_DIR for /usr/local/etc in the examples below. Note that the same techniques can be used in shell scripts.

FUE initialization for csh family:
   #
   # Typical .login snippet, near top of file:
   # get ups environment, and then setup the login product
   #
   if ( -f "/fnal/ups/etc/setups.csh" ) then
       source "/fnal/ups/etc/setups.csh"
       if ( { ups exist login } ) then
           setup login
       endif
   endif
   #
   # Typical .cshrc snippet, near top of file:
   # Get ups environment, and then setup the shrc product
   # 
   if ( -f "/fnal/ups/etc/setups.csh" ) then
       source "/fnal/ups/etc/setups.csh"
   endif

   if ( { ups exist shrc } ) then
       setup shrc
   endif

FUE initialization for sh family:
   #
   # Typical .profile snippet, near top of file:
   # Get ups environment, and then setup the login product
   # 
   if [  -f "/fnal/ups/etc/setups.sh" ]
   then 
       . "/fnal/ups/etc/setups.sh"
       if ups exist login
       then
           setup login
       fi
   fi
   #
   # Typical .shrc snippet, near top of file:
   # Get ups environment, and then setup the shrc product
   # 
   if [ -f "/fnal/ups/etc/setups.sh" ]
   then
       . "/fnal/ups/etc/setups.sh"
   fi

   if ups exist shrc
   then
       setup shrc
   fi

A Picture is Worth A Thousand Words...

.login

 

     

/usr/local/etc/setups.csh

 
     

setup login

 

 
   

setup setpath

smaller modules

 

setup setterm

easier to

 

setup xwin

fix and

 

Info

update

 

# minimal login code

 

 

# fermi .cshrc

 

 

 

 
     

.cshrc

   
   

/usr/local/etc/setups.csh

 
setup shrc   table-file driven
  #minimal shrc code so csh & sh always
    in synch

Converting existing systems to the new methodology

systools v6_0 relies on a new product called template_home, which contains the templates for the login scripts which are given to new accounts via cmd adduser (one of the systools utilities). The template_home scripts use the new FUE syntax; therefore, all new accounts created via "cmd adduser" will have the new FUE syntax.

However, existing accounts' login scripts will need to be converted to use the new FUE syntax.

We will soon be providing a product, convert_template_home, to assist in this conversion. It will be documented briefly here, with full documentation in the usual places.