Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX 10.0 File System Layout White Paper > Chapter 2 The New File System Layout

2.1 Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

2.1.1 Philosophy of the New Layout

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:

  • The overall layout is based on a defacto industry standard. Customers with inter-vendor networks will find the HP-UX file system to be similar to that used by other vendors. When supporting multiple platforms, developers will require fewer HP-UX-specific designs.

  • Files are organized by various categories, such as static vs. dynamic, executable vs. configuration data, etc. This provides a logical structure to the file system, as well as providing the benefits listed in the following items.

  • The operating system is kept separate from the applications on the system, and applications are kept separate from each other. This facilitates a manageable client/server file sharing model.

  • Files that may be shared among hosts are kept separate from files that pertain only to a particular host. This facilitates sharing file system hierarchies over a network for both the diskless and client/server models.

  • Configuration data, which is host-specific, is kept separate from the executable code that uses the data, allowing the code to be shared among hosts. In addition, since configuration data never appears in the same file as the code that uses it, changes made by the customer to the configuration data are not lost when installing future HP-UX updates.

  • Important system configuration data is kept separate from temporary files, log files, and other by-products of system execution that are not required for correct operation of the system. This eases the tasks of system backups and disk space administration.

  • The portion of the file system that is allowed to “grow” is restricted to a manageable subset of directories, simplifying the task of disk space administration.

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.

2.1.2 File System Layout Overview

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.

Figure 2-1 Generic File System Model

Generic File System Model

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.

Figure 2-2 The tree

The tree

The static (shared) subdirectories are:

  • /usr-- OS commands, ksh, vi, libraries

  • /sbin -- minimum commands to boot and mount other filesystems the application subdirectories of /opt

The dynamic (private) subdirectories are:

  • /opt -- applications

  • /home -- user directories

  • /etc -- system configuration (no programs!)

  • /stand -- kernel, boot loader

  • /dev -- device files

  • /tmp -- OS temporary files

  • /var -- dynamic info logs, spooler

  • /mnt -- local mounts

2.2 File System Layout Specification

This section describes the differences in the layout between HP-UX Release 9.x and 10.x.

2.2.1 General Definitions

The following are general rules for the new layout:

  • The shareable portion of the OS resides beneath /usr and /sbin. Only the operating system may install files into these hierarchies.

  • Applications reside in subdirectories beneath /opt. This is the recommended install point for applications.

  • Directories /usr, /sbin, and the application subdirectories of /opt are shareable among networked hosts. These hierarchies must not contain host-specific information. All host-specific configuration data, temporary files, log files, and other files inappropriate for sharing among hosts must reside in private directories on the file system. The private directories include /etc, /var, /tmp, /stand, /home.

  • The /etc directory is used exclusively for host-specific configuration data essential to the correct operation of the system. This directory no longer holds executable commands.

  • The /var hierarchy contains host-specific files created during execution of the system that are not essential configuration information. Examples of files that reside here are log files, temporary files, and printer spool files.

  • The /home directory is the root for all users' home directories.

  • The /export directory is the root for sharable, networked file systems, such as NFS exported directories.

10.x Directory Definitions

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

HP-UX 10.xPre-HP-UX 10.0Description/CommentsPrivate/Shared
/devNo ChangeDevice files for local devicesprivate
/etcNo ChangeMachine-specific configuration and administration databases. No executables invoked by usersprivate
/etc/opt/<application>N/AApplication-specific configuration filesprivate
/etc/rc.config.dN/AStart-up configuration filesprivate
/exportN/ADefault root of exported file systemsserver directory
/export/private_rootsN/ADefault root of exported file systemsserver directory
/export/shared_rootsN/AFor shared OS and applicationsserver directory
/home/usersDefault for user directoriesprivate
/home/<username>/users/<username>User home directoryprivate directory or local mount point
/lost+foundNo ChangeStorage directory for fsckprivate
/mntNo ChangeMounting point for local file systemsprivate
/netNo ChangeMounting point for remote file systemsprivate
/optN/ARoot for optional applicationsprivate
/opt/<application>/usr/<application>Application executables, libraries, and support files.shared
/sbinN/AEssential system commands (those needed to boot system and mount file systems).shared
/sbin/init.dN/AStart-up and shutdown scriptsshared
/sbin/rc#.dN/AStart-up and shutdown link files for script sequencing.shared
/standN/AStandalone machine-dependent binaries and kernel configs.private
/tmpNo ChangeSystem-generated temporary filesprivate
/usrNo ChangeMount point for sharable user commands, libraries, and documentation.shared
/usr/bin/usr/bin and /binOS user commandsshared
/usr/ccsN/AUnbundled development packageshared
/usr/ccs/binN/ADevelopment binariesshared
/usr/ccs/libN/ADevelopment librariesshared
/usr/conf/etc/confKernel configurationshared
/usr/contribNo ChangeContributed software.shared
/usr/includeNo ChangeHeader filesshared
/usr/lbinN/ABack-ends to other commands.shared
/usr/lib/usr/lib and /libObject code and object code libraries.shared
/usr/localNo ChangeUser contributed softwareshared
/usr/newconfig/etc/newconfigDefault operating system configuration data files.shared
/usr/oldN/AObsolete filesshared
/usr/sbinN/ASystem administration commandsshared
/usr/shareN/AArchitecture independent sharable files.shared
/usr/share/dict/usr/lib/spellDictionaries for spell and ispellshared
/usr/share/libN/AMisc. sharable files.shared
/usr/share/man/usr/manOS manpagesshared
/varN/AHolds files created at run time, such as log files and temporary files.private
/var/adm/usr/admCommon administrative files and log files.private
/var/adm/crash/tmpKernel crash dumpsprivate
/var/adm/cron/usr/lib/cronCron queueingprivate
/var/adm/swN/ASD directoryprivate
/var/adm/syslogN/AFiles generated by syslogprivate
/var/mail/usr/mailIncoming mailprivate
/var/news/usr/newsNewsprivate
/var/opt/<application>N/AApplication-specific temporary or data filesprivate
/var/preserve/usr/preservePreserved editor files.private
/var/runN/APID filesprivate
/var/spool/usr/spoolSpooled files.private
/var/spool/cron/usr/spool/cronCrontabs and at jobs.private
/var/spool/locks/usr/spool/locksUUCP Lock files. private
/var/spool/lp/usr/spool/lpPrinter spooling.private
/var/spool/mqueue/usr/spool/mqueueOutgoing mail.private
/var/spool/swN/ADefault location for SD depot.private
/var/spool/uucp/usr/spool/uucpUUCP spool directoryprivate
/var/spool/uucppublic/usr/spool/uucppublicIncoming UUCP filesprivate
/var/tmp/usr/tmpApplication generated temporary files.private
/var/uucp/usr/spool/uucpUUCP administration filesprivate

 

2.2.3 Directory Details

This section provides details on each of the directories listed in the previous table.

2.2.3.1 /dev

/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.

2.2.3.2 /etc

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.

2.2.3.2.1 /etc/opt

Applications will store application-specific, host-specific configuration data under /etc/opt/<application>. See section 2.3, “Applications”, for more details.

2.2.3.2.2 /etc/rc.config.d

This directory contains configuration data files for start-up and shutdown scripts.

2.2.3.3 /export

The directory is used to support diskless file sharing. Servers export root directory hierarchies for networked clients.

2.2.3.4 /home

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.

2.2.3.5 /lost+found

/lost+found contains files located by fsck(1m).

2.2.3.6 /mnt

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.

2.2.3.7 /net

Reserved name for mount points for remote file systems.

2.2.3.8 /opt

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.

2.2.3.8.1 /opt/<application>

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.

2.2.3.9 /sbin

/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.

2.2.3.9.1 /sbin/init.d and /sbin/rc#.d

/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.

2.2.3.10 /stand

/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.

2.2.3.11 /tmp

/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.

2.2.3.12 /usr

/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.

2.2.3.12.1 /usr/bin

/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.

2.2.3.12.2 /usr/ccs

The minimal C compiler is located here. The functionality is sufficient to build a kernel. The fully-functional C compiler resides below /opt.

2.2.3.12.3 /usr/conf

/usr/conf is a static directory containing the sharable kernel build environment.

2.2.3.12.4 /usr/contrib

This directory contains contributed software. The 10.x layout has no changes to this directory.

2.2.3.12.5 /usr/include

/usr/include contains header files. The 10.x layout has no changes to this directory.

2.2.3.12.6 /usr/lbin

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.

2.2.3.12.7 /usr/lib

/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.

2.3.12.8 /usr/local

/usr/local is for site local files, including binaries, libraries, sources, and documentation. HP will deliver this directory empty and not install software here.

2.2.3.12.9 /usr/newconfig

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 /.

2.2.3.12.10 /usr/old

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 /.

2.2.3.12.11 /usr/sbin

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.

2.2.3.12.12 /usr/share

This hierarchy contains architecture-independent sharable files that can be shared among various architectures (for example, terminfo files).

2.2.3.12.13 /usr/share/dict

This directory contains spell and ispell dictionaries.

2.2.3.12.14 /usr/share/doc

This directory contains HP-UX operating system documentation on various topics that is not delivered with other parts of the system.

2.2.3.12.15 /usr/share/lib

This directory is for miscellaneous sharable files. For example, terminfo files will appear beneath this directory.

2.2.3.12.16 /usr/share/man

This directory is for man pages. Processed man pages (for example, /usr/share/man/cat1.Z/*) will also be held here.

2.2.3.12.17 /usr/tmp

A temporary directory symbolically linked to /var/tmp for backward compatibility. This directory is not shared with other systems in a diskless cluster.

2.2.3.13 /var

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.

2.2.3.13.1 /var/adm

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.

2.2.3.13.2 /var/adm/crash

Kernel crash dumps will be located in this directory.

2.2.3.13.3 /var/adm/cron

Used for log files maintained by cron, and cron fifos.

2.2.3.13.4 /var/adm/sw

Used by SD, the HP OpenView Software Distributor.

2.2.3.13.5 /var/adm/syslog

System log files generated by syslog (see syslogd(1M) and syslog(3C)) will go into this directory.

2.2.3.13.6 /var/mail

Directory where incoming mail messages are kept.

2.2.3.13.7 /var/news

Electronic bulletin board files used by news(1) will be kept here. Formerly /usr/news.

2.2.3.13.8 /var/opt

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.

2.2.3.13.9 /var/preserve

Files preserved by vi will be stored here. Formerly /usr/preserve.

2.2.3.13.10 /var/run

PID files for daemon programs will be stored in /var/run, NOT in /etc.

2.2.3.13.11 /var/spool

Host-specific spool files are located here. In general, /usr/spool becomes /var/spool.

2.2.3.13.12 /var/tmp

/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.

2.2.3.13.13 /var/uucp

UUCP administration files will reside here.

2.3 Applications

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, applications are located separate from the operating system under /opt. They do not reside below /usr and /sbin, which are OS directories. This allows for separate application product directories that can span OS revisions, and allows easier disk partitioning management.

  • System administrators are able to easily identify the location of all files related to an application.

  • Critical information is easily backed-up because all application configuration files are contained beneath one hierarchy.

2.3.1 File Layout

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.

NOTE: bin, lbin, lib, share, and newconfig look like /usr.

Figure 2-3 Application File Layout

Application File Layout

2.3.2 Commands and Libraries

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.

2.3.2.1 NLS Message Catalogs

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.

2.3.3 Manpages and Other Architecture-Independent Files

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.

2.3.4 Configuration Files

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.

NOTE: Dynamic files, such as logs and configurations, should never be loaded directly into their target locations in /etc or /var (This may overwrite current data). These should be delivered below /opt/<application>/newconfig, as specified in section 2.2.3.12.9, “/usr/newconfig”, and moved into place during product configuration.

2.3.5 Logs and Temporary Files

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.

2.3.6 Path Variables

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:

/etc/PATH location of commands
/etc/MANPATH location of man pages

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.

2.4 General Impacts to Developers and Users

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.

2.4.1 Embedded Pathnames

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:

  • Program source, headers and make files.

  • Scripts (ksh, psh, sh, awk, sed, etc.)

  • Libraries

  • Binaries and Object code

  • Message catalogs and help/man files

For solutions to finding embedded pathnames, see section 2.5.1, “Finding Embedded Pathnames.

2.4.2 Environment Variables

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.

2.4.3 Build & Test Environments

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.

2.4.4 Documentation

Many applications have detailed documentation outlining the product installation locations. Documentation should also be scanned for obsolete path names.

2.5 Solutions to Commonly Asked QuestionsThis section includes both tips and answers to commonly asked questions regarding the file system layout and the upgrade from HP-UX 9.x to 10.x.

2.5.1 Finding Embedded Pathnames.

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.

2.5.1.1 HP Tools

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.

2.5.1.2 “strings” command

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.

2.5.2 Finding New Locations of Files

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.

2.5.3 Building PATH Variables

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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1994 Hewlett-Packard Development Company, L.P.