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 locationsIn 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.*shrcThe 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:
Changes being made to login scriptsTo 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:
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 scriptsThere 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:
|