The goals of these policies are to make any installed software easy to locate, easy to maintain and use, and easy to de-install. The purpose of this document is to set some guidelines as to where and how software should be installed on the Computer Center systems. When this document speaks of "software", the reference is to third-party or locally written software that has been added to the computer system and which is not part of the operating system as released by the vendor.
Also, the /admin directory is an CSD convention and was created to house security-sensitive or other specialized software that can only be run by root, i.e. the nightly backup program. This document will not focus on /admin, but will address the system administration policies as they relate to software to be installed in /v/site and/opt.
Any software (as defined above) installed by CSD staff should reside in one of two locations:
/v/site/packages
/opt/depot
The /v/site filesystem is available to all computer systems via NFS, and should only contain software that is meant to be shared. There are two main subdirectories in /v/site: /v/site/packages and /v/site/os. The directory /v/site/packages is the one that most people will be using, and is the focus of this document. It contains a subdirectory for each installed product that is freely available, i.e. elm, perl, etc. The /v/site/os directory contains software that must be handled in a special way, and will be described later in the section entitled Exceptions.
The /opt filesystem is not available via NFS, and should contain software that is meant to be run only on the SPARCcenter 2000. There are several directories under /opt. The one of most concern in this document is /opt/depot which, like /v/site/packages, contains a subdirectory for each installed product. However, in addition to the subdirectories for the products which are specific to the SPARCcenter 2000, i.e. matlab, /opt/depot also contains soft-links to each product directory found in /v/site/packages. For example, /opt/depot/elm is a soft-link to /v/site/packages/elm. Therefore, /opt/depot contains an entry for each and every product installed on the SPARCcenter2000.
Each product is to be compiled and installed using /opt/depot/ package_name as the target directory, even if the product is physically located in the directory /v/site/packages/package_name. Furthermore, the product's executables should be installed in a bin subdirectory, any libraries should be installed in a lib subdirectory, and any man pages should be installed in a man subdirectory. For example, the product elm is installed into the directories/opt/depot/elm/bin, /opt/depot/elm/lib, and opt/depot/elm/man. It bears emphasizing that there is a difference between the physical allocation of software and the logical location of software. While sharable software is physically located in /v/site/packages, all software is logically installed in /opt/depot.
By utilizing some locally-written perl scripts, collectively known as opt_depot, the executables, libraries, and man pages that are generated as a result of compiling each individual product are soft-linked together into the directories /opt/bin, /opt/lib, and /opt/man. That is, all executables from each product can be found in /opt/bin, all libraries from each product are found in /opt/lib, and all man pages from each product are found in /opt/man. There will be other directories created in /opt as needed (/opt/info and /opt/include), depending on the products and the files they create.
Thus, /opt logically contains all software that has been added to the computer system. In this way, a single directory, /opt/bin, can be placed in the default pathname, PATH, in order to use all products that have been added to the system. The same is true for the directories /opt/lib and /opt/man, which are used in the LD_LIBRARY_PATH and MAN_PATH variables.
If the software is freely distributable, site licensed, or written by CSD and meant to be shared with other systems, then it should physically reside in /v/site/packages.
If the software is not freely distributable, site licensed, or meant to be shared with other systems, then it should physically reside in /opt/depot.
If the software is to be installed into /opt/depot, as opposed to /v/site/packages, then running opt_link is not necessary (but will not hurt).
Remember: It is crucial that the software is compiled and installed so that it looks for all of its files using the path /opt/depot/<packagename>. This should be the only hard coded path in your package.
Note that installing directly into a /opt/depot/<packagename> linked to your Central Package Archive only works if the machine on which you compiled the package has write access to your Central Package Archive. If the local machine compiling the package does not have write access to the Central Package Archive, you can make a directory anywhere on the local machine and make a symbolic link from /opt/depot/<packagename> to your new directory, run your installation process, make a tar file of /opt/depot/<packagename>, ftp this tar file over to your Central Package Archive, and de-tar. You can then run opt_setup to take linking everything into your Local Installation Directory.
More concretely,
NOTE: The opt_depot script uses a lock file called lock.opt_depot to prevent two users from running opt_depot at the same time. This lock file is created in the destination directory (i.e. /opt) and is automatically removed when the run is completed. However, if the user CTRL C's out of opt_depot, the lock file is not removed and the next time opt_depot is invoked, an error message will be displayed indicating that someone else might still be running opt_depot. Remove the file /opt/lock.opt_depot and run opt_depot again.
Occasionally, there are files and packages to be linked into /opt which share the same name. When opt_depot is run, it will generate a "name conflict" error message when it has already created a link of a certain file name, and then finds a second file by the same name that needs to be linked. There are three ways to resolve file name conflicts when running opt_depot. The choice as to which is most practical depends on the individual situation.
The /opt/.priority file can contain either individual file names or software package names, specified either by absolute pathname or pathname relative to the /opt/depot directory. Each entry should be separated by a newline character, and comments are denoted by a pound sign (#) as the first character on a line. The order in which file names or package names are placed in the file determines the priority of the file or package and the one with the highest prioritywill be the one linked in /opt/bin, /opt/lib, /opt/man, etc. If there are two files by the same name, and one is listed in the priority file and one is not, then the one listed has the highest priority. If neither of the files are listed in the priority file, then the first one linked remains.
An example /opt/.priority file follows:
# This is the /opt/.priority file for determining opt_depot linking priorities
# Version 19.19 of gnuemacs will have priority over version 18.57
gnuemacs~19.19/bin/emacs
gnuemacs~18.57/bin/emacs
# The lmstat file in idl will have priority over all other files by that name
/opt/depot/idl/bin/lmstat
An example /opt/.exclude file follows:
# This is the /opt/.exclude file to keep opt_depot from linking files
# X Windows software X11R4 will not be linked into /opt
/opt/depot/X11R4
The exception to the policies described above is software that is a replacement for an executable that comes with the operating system, i.e. /usr/bin/login. In that case, the software should be installed in the directory that the operating system expects to find it, and the original version of the software should be renamed with an extension of .dist, i.e. /usr/bin/login.dist. In addition, a copy of the new executable should be kept in /v/site/os. In this way, the software is made available to others via NFS, but they must take some positive action in order to use it, such as copy it into their own /usr/bin directory. It will not be available in their default pathway.
Every directory in /v/site/packages and /opt/depot should have a file called ARLUT_README, which should be an on-line version of what is kept in /sysmods.jnl and the Software Maintenance Logs. This file is to include (but is not limited to) such information as to what the package is and what it does, the name of the person installing it, the date of installation, where the sources were obtained, any special information about how the software was installed, and anything else that might be helpful to someone else. By no means should this file be considered a replacement for /sysmods.jnl or the Software Maintenance Logs, which are kept by the system administrators of each system.
All sources are to be kept in the /sources directory. There are three primary subdirectories: opt, site, and os. Sources for software that physically resides in /v/site/packages should be kept in /sources/site/package_name. Sources for software that physically resides in /opt/depot should be kept in /sources/opt/package_name. In cases of software that have version numbers associated with them, it is also appropriate to have a further subdirectory that indicates the version number. For example, one might have /sources/site/elm/elm1.0 and /sources/site/elm/elm2.0. Sources for software that is are placement for standard operating system software (such as /usr/bin/login), should be kept in /sources/os.
There is one more script in the opt_depot suite, called opt_setup. This script is not normally run on the Computer Center host machines. It was written for those systems which NFS mount the /v/site volume for the purpose of using the software located there. The process is fully documented elsewhere, but the basic steps required are that the system administrator NFS mount the /v/site volume and then run the script /v/site/opt_setup, which then calls opt_link,opt_clean, and opt_depot.
In this diagram, /v/site is the OS specific NFS mounted site volume that contains all the site-wide packages for the laboratory. /v/site/os contains all the scripts that are used to manage /opt on the client side. /v/site/packages contains all of the installed packages in separate directories. These will be linked under /opt/depot as shown on the client side diagram.