How Configuration Files Play Together


From the material covered so far, you've probably concluded correctly that CDE configuration files aren't something to go hacking at without a plan - a well-thought-out plan. You've probably figured out that the element you want to configure and the breadth of influence you want it to have determine which configuration file you modify.

For instance, if you wanted to set an environment variable, you have a choice of four configuration files: sys.dtprofile, Xconfig, Xsession , and .dtprofile . But if you want to set environment variables that affect only a particular user , your choice immediately narrows to a single file, .dtprofile .

Now the only remaining piece of the puzzle is to understand the order in which CDE reads its configuration files. When a configuration element (an environment variable, resource, action, or data type) is specified twice but with different values, you obviously want the correct value used and the incorrect value ignored.

The following rules apply:

  • For environment variables, the last specified value is used.

  • For resources, the last specified value is used. However, this is influenced by specificity. Thus, emacs*foreground takes precedence over just *foreground for emacs clients , regardless of the order in which the resources were encountered .

  • For actions, the first specified is used.

  • For data types, the first specified is used.

Table 14-4 illustrates which specification is used when CDE reads multiple specifications of configuration elements in its configuration files:

Table 14-4. What CDE Uses for Configuration

Configuration Element

Element Used

resource

last encountered or most specific

environment

last encountered

action

first encountered

file type

first encountered

Put in terms of scope, a user configuration file overrides a system-wide configuration file. Looking at the order of precedence of just system-wide configuration files, the files in /etc/dt have precedence over those in /usr/dt , so global custom configurations have precedence over the CDE default configuration. And $HOME/.dt files take precedence over those in /etc/dt.

For resources, the elements used to specify a GUI's appearance and behavior, CDE sets values according to the following priorities:

  1. Command line - When you start a client from the command line, options listed on the command line have top priority.

  2. Xresources, .Xdefaults, dt.resources, sys.resources, - When CDE starts, it reads these resource configuration files to determine the value of X resources to use for the session.

  3. RESOURCE MANAGER - Resources already in the property RESOURCE_MANAGER may affect an application that is just starting.

  4. app-defaults - Specifies "default" resource values that differ from built-in resource values.

  5. built-in defaults - Default resources that are "hard-coded" have the lowest priority.

Specific resource specifications take precedence over general resource specifications. For example, suppose that you want a certain font in your text entry areas. You could correctly specify a *FontList resource in your personal .Xdefaults file, only to have it overwritten by an *XmText*FontList in an app-defaults file. Although app-defaults is of lower priority than .Xdefaults , the resource specification set there is more specific, so it takes precedence.

For environment variables, CDE sets values according to the following priorities:

  1. $HOME/.dtprofile - User-specific variables have top priority.

  2. /etc/dt/config/C/Xsession - Custom system-wide variables not read by X server.

  3. /etc/dt/config/C/Xconfig - Custom system-wide variables read by X server.

  4. /usr/dt/config/C/Xsession - Default system-wide variables not read by X server.

  5. /usr/dt/config/C/Xconfig - Default system-wide variables read by X server.

  6. / usr/dt/bin/dtlogin - Built-in default variables have the lowest priority.

For data type and action definitions, CDE looks for .dt files according to the following priority:

  1. $HOME/.dt/types

  2. /etc/dt/appconfig/types/C

  3. /usr/dt/appconfig/types/C

Remember that for data types or actions, the first value that it finds is the one it uses. So if you just can't get a file type or action to work, check for a duplicate entry earlier in the file or for an entry in a file with higher priority. Note also that the environment variable DTDATABASESEARCHPATH can be set either in /etc/dt/config/Xsession or $HOME/.dtprofile , to add directories where CDE can search for file type and action definition information.



HP-UX 11i Systems Administration Handbook and Toolkit
HP-UX 11i Systems Administration Handbook and Toolkit (2nd Edition)
ISBN: 0131018833
EAN: 2147483647
Year: 2003
Pages: 301

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net