Login File Changes


History:
Abstract:

Changes are being made to improve the consistency and maintainability of the ups login files. Most of the files in the /usr/local/etc directory are being retired. The only required files in /usr/local/etc will be setups.csh and setups.sh; all other ups files will be located via the ups database(s). This report provides some details on the new ups file locations, and the changes being made to login scripts.


New ups file locations

In The Old Days ®, commonly-used files, including those needed to set up the ups environment, were placed in the /usr/local/etc directory. This was useful in that it provided a well-known place to start, but it had some serious disadvantages. Because the related /usr/local/bin directory had to be platform-specific, generally the /usr/local/etc directory was platform-specific as well, and in cases was local to many individual machines. This arrangement made for considerable difficulty in maintaining the files in these directories. Also, only a single version of the ups files was available, with no easy way for test versions to be installed. Another difficulty was that two flavors of scripts had to be maintained, one for each shell family. These problems have been addressed in a new set of products which are used to set up the ups environment. These products are:
  template_home v1_1 -f NULL
  |__login v1_1 -f NULL
  |  |__setpath v1_1 -f NULL
  |  |__setterm v1_1 -f NULL
  |  |__setxwin v1_1 -f 
  |__shrc v1_1 -f 
The template_home product contains the user login scripts ( .bashrc, .cshrc, .login, .profile, and .shrc), and contains the only references to files which need to live outside the confines of the ups product area. These references to the setups.csh and setups.sh scripts are the means for establishing the location of the ups database(s) in the user's environment, and are all that ups needs to get started. These setups.*sh files will be located in one of three places:
  1. The typical location for Fermilab systems is /usr/local/etc, although the system manager may choose to put them elsewhere. There should always be "courtesy links" in /usr/local/etc in any case for support.
  2. On the fnalu cluster, the location is /afs/fnal.gov/ups/etc. This allows login files in afs space to also work on other machines with their own /usr/local/etc directories. This wouldn't (necessarily) be the case if the fnalu cluster used /usr/local/etc for its setups.*sh files.
  3. On the oss build cluster, the location is /fnal/ups/etc, and there will be no /usr/local/etc/setups.*sh files, as a precaution against accidental dependencies.
Besides the advantages of having the login process no longer dependent on the /usr/local/etc directory, the new login product and its dependencies have the advantage of being entirely contained in table files, and have a single code base for both shell families. All of the functions formerly handled in the /usr/local/etc/fermi.* and setpath.* scripts are now handled by these new products. The shrc product still sources any /usr/local/etc/local.*shrc files that the system manager has provided.


Changes being made to login scripts

To bring existing login scripts up to date with the new scheme for setting up the ups environment, wherever invocations of the old /usr/local/etc files are encountered in users' .bash_profile, .bashrc, .cshrc, .login, .profile, and .shrc scripts, the following actions are taken:

If no old-style invocations are found, no changes will be made, not even the removal of old copyright notices. Links are ignored.

The comment string used is ': #_UPS_# ', so that the changes made can be readily seen. The large majority of cases will look like the following:

  : #_UPS_# if ( -r /usr/local/etc/fermi.profile ) then
  : #_UPS_#   source /usr/local/etc/fermi.profile
  : #_UPS_# endif

The colons in these rather odd-looking comment strings are included to make the lines executable (as no-ops, essentially) so that the Korn-shell family doesn't complain about empty if-then-fi sequences, as in the next example.

Be aware that due to the limitless variety possible in invocations of the /usr/local/etc scripts, there may be some odd-looking results in certain cases. In these cases only the 'source' line will be commented out, and the surrounding lines will be left intact. For example:

  if [ -f /usr/local/etc/fermi.login -a -f arbitrary.file ]
  then
  : #_UPS_#   . /usr/local/etc/fermi.login
  fi

Note that semantic errors like broken if/then/endif constructs will not be fixed; only well-formed code is affected. Once you are happy with the changes, feel free to delete the commented lines, plus any surrounding code which is no longer useful.

There are a few of you who have such a unique way of doing things, that no amount of regular-expression trickery will suffice. You are on your own, but since you're the strong, independent types, this shouldn't be a big problem for you. You may inform yourselves in the new Fermilab standard way of doing things by examining the template files in one of the following directories:

  /afs/fnal.gov/ups/template_home/v1_1/NULL/dotfiles.localized
  /fnal/ups/template_home/v1_1/NULL/dotfiles.localized

Questions or concerns may be sent to uas-group@fnal.gov.