| United States-English |
|
|
|
![]() |
HP-UX 10.0 File System Layout White Paper > Chapter 2 The New File System Layout2.1 Introduction |
|
The 10.x file system layout is similar to the OSF/1 and SVR4 layout. Important features of the HP-UX 10.x file system layout include:
Although the 10.x file system layout is based on the OSF/1 and V.4 file system layouts, it is not a “pure” implementation of either of these layouts. Industry compatibility is of great importance. However, it is important to note that all of the major vendors supporting V.4 have slightly different implementations and their respective documentation should be consulted. One of the primary benefits of the 10.x file system layout is that it categorizes and groups together files by functionality (static, dynamic, executable, configuration information, etc.). This organization is depicted in Figure 2-1. In the above figure, files are primarily categorized as static and dynamic. Dynamic files, which include files like log and configuration files, are further categorized by functionality (configuration, temporary, and user). A similar division is possible with the static files, where files may be categorized by three functionalities: executable, library and system start-up. File types can further subdivided into user or system, OS or Application, etc., as illustrated in the figure above. This grouping of files also supports the diskless paradigm by arranging the file system in a manageable fashion and allowing a clean sharing of file system resources in a client/server environment. In the diskless paradigm, directories are considered shared among clients (such as executables) or private to a client (for example, configuration and temporary files). This shared vs. private distinction conforms well to the static vs. dynamic distinction given above; in 10.x, static files are shared, while dynamic files are private. Figure 2-2 represents the directory tree of the 10.x file system layout, showing this private/dynamic vs. share/static distinction. The static (shared) subdirectories are:
The dynamic (private) subdirectories are:
This section describes the differences in the layout between HP-UX Release 9.x and 10.x. The following are general rules for the new layout:
The following table outlines most of the directories found in the HP-UX file system. For each directory, it shows the old directory name, where applicable, and the associated use for the directory. The last column of the table indicates whether the directory is shared among members of a cluster or is private to the host. Each directory is explained in detail in Section 2.2.3, “Directory Details”. Table 2-1 HP-UX 10.x Directory Definitions
This section provides details on each of the directories listed in the previous table. /dev is used for device files. The contents and meaning of /dev has not changed. Nothing should be installed in /dev. Instead, configuration files should create node-specific device files. The /etc hierarchy contains host-specific system and application configuration files important to the correct operation of the system. Files located here are usually fixed size and do not grow. By contrast, the /var hierarchy holds files that are dynamic in length or are less critical to system execution, such as log files. In general, /etc holds essential information that must be preserved in order for the system to function correctly, while /var holds information generated by the system that may be disposed of when it is no longer of interest. Some customer sites may choose to make automatic backups of the /etc hierarchy, but not of /var.There will be subdirectories under /etc for some systems; for example /etc/mail and /etc/uucp for the mail system and uucp respectively.The /etc directory itself is used only for system configuration files. /etc no longer contains commands, rc scripts, log files (with the exception of a few critical log files), or other files not related to system configuration. Most commands have moved to /usr/sbin. Rc scripts now reside in /sbin/init.d and follow the new system start-up and shutdown paradigm (see Section 3., “System Start-up/Shutdown Model”). Log files and other miscellaneous files not related to system configuration are now in /var. Applications will store application-specific, host-specific configuration data under /etc/opt/<application>. See section 2.3, “Applications”, for more details. The directory is used to support diskless file sharing. Servers export root directory hierarchies for networked clients. User directories will be created and managed under /home instead of /users. Nothing should be installed in /home. This is a portion of the file system that is allowed to grow. Reserved name for mount points for local file systems. This is not an install location (that is, nothing should be directly installed here from HP update media). /mnt can be used as a mount point directory, or a directory containing multiple mount points. The root directory for optional applications. /opt is not a sharing point, but rather, its subdirectories are sharing points. This allows one to mount only those applications that make sense for a given machine or release, rather than mounting all applications available on a server. No files should be delivered into /opt, but rather into subdirectories of /opt, as described below. The shareable portion of each optional application resides in a hierarchy beneath a single subdirectory of /opt. A uniform application structure is recommended, which consists of the following standard set of directories under /opt/<application>: bin, lib, man, help, lbin and newconfig for default configuration info. See section 2.3, “Applications”, for more details. /sbin contains the commands and scripts essential to boot and shutdown a system. /sbin contains the commands required to bring the system into a state in which the /usr filesystem can be mounted and the boot process continued. /sbin also contains commands needed to fix filesystem mounting problems. Commands in /sbin must not depend on any filesystems that may not be mounted at the time the command must execute, including the /usr, /var, and /opt filesystems. Since shared libraries reside beneath /usr, commands in /sbin are statically linked (that is, built with archived libraries). Commands in /sbin must not execute any commands from the /usr filesystem; only other /sbin executables may be referenced. If a command referenced by an /sbin command is replicated between /sbin and either /usr/bin or /usr/sbin, then the path to the command must refer to the /sbin version. Some commands in /sbin are duplicates of, or the target of symbolic links from, other commands in /usr/bin and /usr/sbin. For example, the ls command exists in both /sbin and /usr/bin. If a command in /sbin is duplicated in either /usr/bin or /usr/sbin, the duplicate exists to take advantage of shared libraries for most executions of that command, or to provide full functionality if the /sbin version does not. Some commands in /sbin do not offer the full functionality provided by their /usr/bin or /usr/sbin counterparts. For example, some NLS functionality that requires shared libraries is not present in the /sbin versions of certain commands. For this reason, use of the /usr/bin or /usr/sbin versions of replicated commands is preferred, when possible. When constructing shell PATH variables that contain a /sbin component, /sbin should appear after /usr/bin and/or /usr/sbin in the path. /sbin/init.d contains all rc scripts used to start-up and shutdown various subsystems./sbin/rc#.d contains ordered symbolic links to rc scripts in /sbin/init.d that are executed when changing run levels.See Section 3, “System Start-up/Shutdown Model”, for more information. /stand is for system-specific kernel configuration and binary files. The files are typically needed at boot time to bring up a system. This directory is not an install point. /tmp is for system-generated temporary files. The contents of /tmp are usually not preserved across a system reboot. The choice of whether or not /tmp is cleaned up at boot time is left to the customer.The /tmp directory is private. Since many sites will delete files from /tmp at boot time, files that must be preserved should not be placed in the /tmp directory. Application working files should go in /var/tmp or /var/opt/<application>. Files generated by the OS that must be preserved across reboots should go into the /var/tmp directory. /usr contains the bulk of the operating system, including commands, libraries and documentation. The /usr file system contains only shareable operating system files, such as executables and ASCII documentation. Multiple systems of compatible architectures should be able to access the same /usr directories. /usr may be mounted as read-only by diskless clients, and thus may not be writable by clients.The allowed subdirectories in /usr are defined below; no additional subdirectories should be created. Any 9.x applications that resided in other subdirectories in /usr have moved beneath the /opt hierarchy. /usr/bin is used for common utilities and applications. In general, commands documented in section 1 of the HP-UX Reference Manual reside in /usr/bin, while commands documented in section 1M reside in /usr/sbin. The minimal C compiler is located here. The functionality is sufficient to build a kernel. The fully-functional C compiler resides below /opt. /usr/conf is a static directory containing the sharable kernel build environment. This directory contains contributed software. The 10.x layout has no changes to this directory. /usr/include contains header files. The 10.x layout has no changes to this directory. The /usr/lbin directory is intended for back-ends to commands in the /usr hierarchy. Commands such as /usr/lib/divpage and /usr/lib/diff3prog are placed in /usr/lbin. There are some subdirectories for special systems, such as /usr/lbin/spell and /usr/lbin/uucp. /usr/lib holds libraries and machine dependent databases. In 10.x, most files that once resided in /lib now reside in /usr/lib. There is no /lib directory; code referencing /lib should be changed to reference the correct path. /usr/local is for site local files, including binaries, libraries, sources, and documentation. HP will deliver this directory empty and not install software here. This directory contains default operating system configuration data files. Files that once resided in /etc/newconfig might now reside in /usr/newconfig or /opt/<application>/newconfig. The structure of /usr/newconfig is different than that of /etc/newconfig: /usr/newconfig contains a directory hierarchy somewhat mirroring that of /. During an operating system update, this directory is used for host customization. System files being replaced by files in /usr/newconfig, will be moved here. It is also used to hold old versions of software for compatibility with a previous release. /usr/old contains a directory hierarchy somewhat mirroring that of /. The directory /usr/sbin is for system administration related commands. Many of the commands previously in /etc have moved to this directory. In general, commands documented in section 1M of the HP-UX Reference Manual are in /usr/sbin. This hierarchy contains architecture-independent sharable files that can be shared among various architectures (for example, terminfo files). This directory contains HP-UX operating system documentation on various topics that is not delivered with other parts of the system. This directory is for miscellaneous sharable files. For example, terminfo files will appear beneath this directory. This directory is for man pages. Processed man pages (for example, /usr/share/man/cat1.Z/*) will also be held here. This directory is for multipurpose log, temporary, transient, variable sized, and spool files. The /var directory is extremely “variable” in size, hence the name. In general, any files that an application or command creates at run time, and that are not critical to the operation of the system, should be placed in a directory that resides under /var. For example, /var/adm will contain log files and other run time-created files related to system administration. /var will also contain variable size files like crontabs, and print and mail spooling areas. In general, files beneath /var are somewhat temporary. System administrators that wish to free up disk space are likely to search the /var hierarchy for files that can be purged. Some sites may choose not to make automatic backups of the /var directories. If a product locates important configuration files here that do not fit under /etc, it is recommended that documentation explicitly reference /var files to back-up. /var should not be placed on a small, fixed-size partition. Also, /var is not an install point. This directory hierarchy is used for common administrative files, logs, and databases. For example, files generated by syslog(3C), files used by cron(1M), and kernel crash dumps will be kept here and in subdirectories. Host-specific administration information will also be kept here. /usr/adm has become /var/adm. System log files generated by syslog (see syslogd(1M) and syslog(3C)) will go into this directory. Electronic bulletin board files used by news(1) will be kept here. Formerly /usr/news. Application run time files (for example, logs, status, temporary files) for applications mounted in /opt will be stored in /var/opt/<application> for each application. Host-specific spool files are located here. In general, /usr/spool becomes /var/spool. /var/tmp is for user temporary files generated by commands in the /usr hierarchy. Files located here are preserved between system reboots. Temporary files generated by applications installed under /opt/<application> will use /var/opt/<application> for temporary files. As discussed earlier, the 10.x file system model separates static and dynamic files. Application product file system layouts follow the same conventions and extend the model to provide separation among products. This is accomplished in many ways:
In general, /opt is the application directory. Below here, applications are self-contained in their own directory, /opt/<application>. Shareable files (that may be shared among multiple nodes), such as binaries, man pages and libraries, reside in this directory. Host-specific private files, such as logs and node-specific configurations, are located in the private/dynamic directories under /var/opt/<application> and /etc/opt/<application>, respectively. The application root (/opt/<application>) should contain a subdirectory structure similar to that of /usr: bin, lbin, lib, man and newconfig. Figure 2-3, “Application File Layout”, shows a sample directory structure.
Application binaries and libraries follow the same layout used by the operating system. User commands are located in /opt/<application>/bin, back end commands reside in /opt/<application>/lbin, and shared and archived libraries reside in /opt/<application>/lib. NLS message catalogs for applications should be placed in the /opt/<application>/lib/nls directory. To automatically access these files using the standard NLS interfaces, the NLSPATH environment variable must be set to include the application's message catalog directory. Applications are responsible, upon invocation of any application binaries, to add the correct component to the NLSPATH environment variable. Application manpages are kept separate from OS manpages and reside in /opt/<application>/share/man. Other architecture-independent files that may be shared by more than one system reside below /opt/<application>/share and must follow the same layout conventions specified for the operating system in section 2.2, “File System Layout Specification”. These include object files and libraries, to name a few. System-dependent configuration files for applications reside in /etc/opt/<application> and include files necessary for the proper run-time execution of the product. Files that are by-products of execution are considered temporary files and should be located under /var/opt/<application>. Because all system configurations are located under /etc, system administrators can easily view system and application configurations. This also facilitates backup of configuration data for a given machine.
Temporary files created by applications (products installed in /opt) for use during run time are located in /var/opt/<application>. This includes logs and lock files that are by-products of run time execution, but does not include those configuration files necessary for correct execution of the application. Configuration files reside below /etc/opt. Product binaries, man pages and other files are no longer contained in common system directories. Consequently, the default system path values no longer point to all the installed software and must be adjusted for products as they are added to a system. The new model provides a mechanism to “register” a product's files with the appropriate path variables. Two path variables are considered: PATH and MANPATH. Each variable is addressed with a separate file, each containing a colon-separated list of values representative of the particular path variable:
The system default login files (/etc/profile, /etc/csh.login) appropriately source these files for the respective path variables. The path files should never be directly manipulated by a product's installation processes. SD provides configuration utilities that enable applications to add their product-specific values to the appropriate path variable files. The 10FSL introduces many changes that affect not only software developers, but also users and system administrators. The major change involves filename and directory locations. If you have existing code that needs to be integrated into HP-UX 10.x, some of the common impacts are discussed below. Software developers frequently code pathnames into their source. These paths may appear in header files and library routines, as well as the main body of code. The 10FSL changes require developers to scan these sources for pathname values, evaluate the findings and implement the necessary changes to reflect the correct file system layout. Hard-coded pathnames may be found in:
For solutions to finding embedded pathnames, see section 2.5.1, “Finding Embedded Pathnames.” An important, but often overlooked, area is environment variables. These may be contained in the system and user login files such as ~/.profile, ~/.login, ~/.vueprofile, ~/.cshrc, and /etc/skel/d.*. These are the most common files, but there may be others associated with applications. Be sure to check your system for other possible occurrences. Environment variables that have execution strings or contain paths are likely to be impacted. Be sure to change all path variables to reflect the correct directories where your commands are contained. Developers often keep separate environments for building and testing their systems and applications. This is also an important area to evaluate for hard-coded pathnames. Makefiles and test scripts may contain paths that have been changed as a result of the 10FSL. There are a number of ways to search for embedded pathnames. A few recommended solutions are listed below. However, you should note that these are only suggestions and are not guaranteed to find all embedded pathnames. Each developer should analyze their applications and systems for any other areas that may not execute properly on the 10FSL. Hewlett-Packard provides tools to help users identify and fix absolute pathnames that are obsolete. The tools convert shell scripts (ksh, sh, csh, etc.) and makefiles to comply with the new 10FSL. The same tools that operate on scripts and makefiles also do simple string translations for absolute pathnames found in ordinary ASCII files. On an HP-UX 10.x system, one such tool is /opt/upgrade/bin/analyzer. Please see its accompanying documentation for further details. The strings command is a good alternative. This is most effective on non-ASCII files, but may be used on ASCII text files. See the HP-UX manual page, strings(1), for more details. A sample command is shown below: strings -a <filename> | grep / | sort -u This will produce a unique sorted list of alphanumeric strings containing “/”, indicating either an absolute or relative pathname. This will probably generate a lot of non-pathname results and will need to be searched for valid pathnames. On a pre-10.0 system, the strings command may be found in /usr/bin. On a 10.x system, strings is found under /usr/ccs/bin. HP provides a database and a tool to assist you in locating operating system product files in both the 9.x and 10.x locations. The tool is /opt/upgrade/bin/fnlookup on an HP-UX 10.x system. Please see its accompanying documentation for further details. In the meantime, you may examine a HP-UX 10.x system using the find command: find <path> -print | grep <filename> This will produce the location of the desired file if it is contained below <path>. If not, try another path location. In the 10FSL, there are no longer only a few key places, such as /usr/bin, where executables may be found. Applications will have both manual (“man”) pages and binaries in application directories below /opt. As applications are added to a user's environment, the PATH and MANPATH variables must be updated so that commands and man pages will be found. There is an automated mechanism available to application developers to add their appropriate entries to these paths. However, all applications may not take advantage of this mechanism. In this case, the user will need to manually add to the appropriate path variables. For example, if a (ksh, sh) user has application XYZ and wishes to have the man pages and binaries accessible without fully qualifying the path, both the PATH and MANPATH variables may be updated to resemble: PATH=$PATH:/opt/XYZ/bin MANPATH=$MANPATH:/opt/XYZ/share/man This task would be executed for each application that was added to the user's environment. In some cases, applications may provide this capability during configuration. In other cases, system administrators and users must ensure their variables are set correctly for the environment. This syntax is specific for ksh and sh; csh users must use the appropriate syntax. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||