Login File Changes


Abstract:

Changes are being made to improve the consistency and maintainability of the ups login files. Most of the fermi 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 ups databases.

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 past, 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, not related to the location of the files, 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          Template login scripts
  |__login v1_1 -f NULL               Container for the following
  |  |__setpath v1_1 -f NULL          Path setup
  |  |__setterm v1_1 -f NULL          Terminal setup
  |  |__setxwin v1_1 -f <OS-Flavor>   Display setup
  |__shrc v1_1 -f <OS-Flavor>         MACH vars, sourcing local.*shrc
The template_home product contains the user login scripts (.bashrc, .cshrc, .login, .profile, and .shrc), which hold 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 /usr/local/etc "courtesy links", 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 provided on the system.


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, .bash_login, .bashrc, .cshrc, .login, .profile, .shrc, .tcshrc, and .zshrc scripts, the following actions are taken:

  • A backup copy of each file is made, with an extension of '.UPS_SAVE'.
  • New standard setup code is inserted at the beginning of the file.
  • Old invocations of /usr/local/etc/fermi.* scripts are commented out.
  • Old invocations of /usr/local/etc/setpath.* scripts are commented out.
  • Redundant sourcing of the user's .shrc in .profile scripts is commented out.
  • Old, invalid copyright notices are removed.

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.


Making changes to your own scripts

There are a few of you who have such a unique way of doing things, that automatic modification of your scripts is not possible. Or you may have other scripts which set up the ups environment the old-fashioned way. The template files should provide helpful examples for the new standard approach. These are available in 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 helpdesk@fnal.gov.


History:
  • 4 June 1999: Initial Release.
  • 8 June 1999: Update to discuss the location of setups.*sh files.
  • 1 July 1999: Add more file names, better discussion of template_home.
  • 2 July 1999: Better formatting.