How Enterprise Server Uses Environment Variables

Describes setting the initial environment for all Enterprise Server regions, and how to further configure an enterprise server region by set environment variables that are specific to that particular region.

Initial environment settings

The initial environment used for a specific enterprise server region depends on the method you use to start it:

  • When you start an enterprise server region from the Enterprise Server Common Web Administration (ESCWA) interface, it inherits its environment from the Micro Focus Directory Server Directory Server.
  • When you start an enterprise server region from the command line using the casstart command, it inherits its environment from that command shell.
This means that the initial configuration for all enterprise server regions, including directory settings for third-party software, can be set in the session where you start the Micro Focus Directory Server.
Note: If Micro Focus Directory Server is running as a Windows service, it will have the system environment.

Specific environment settings

You can set environment variables for a specific enterprise server instance in Configuration Information on the Add Server or Edit Server page. These apply to all services that run in the server.

Note: For service interfaces created using the Interface Mapping Toolkit, environment variables set at the service level override the settings at the region level.

The format for environment variables is:

[ES-Environment]
environment-variable-name=environment-variable-setting

Use a semi-colon to separate elements within the string (Windows) or use a colon to separate elements within the string (UNIX). For example:

For Windows:

[ES-Environment]
COBPATH=c:\adirectory;c:\anotherdirectory

For UNIX:

[ES-Environment]
COBPATH=/home/adirectory:home/anotherdirectory
Note: Micro Focus recommends that you do not set the COBDIR environment variable for an enterprise server instance, especially on UNIX. This is because $COBDIR is a reserved environment variable used to point to the product location, and overriding its value could cause undefined results.

Instead, if you want to specify the location of service programs at the region level, consider using the COBPATH environment variable. However, if you do this, you must also specify "$COBPATH" in Package Path in the Add Package or Edit Package page for services that should be located using COBPATH.

To use a defined environment variable in the value definition of another environment variable, precede the name of the defined variable with a dollar sign ($). For example:

For Windows:

FILEROOT=d:\data
FILEA=$FILEROOT\mydata.dat

This resolves to d:\data\mydata.dat.

For UNIX:

FILEROOT=/home/data
FILEA=$FILEROOT/mydata.dat

This resolves to /home/data/mydata.dat.

If you want to include a dollar sign in an environment variable value as part of the actual value and not as an indicator for a referenced environment variable, escape the dollar sign character by inserting a backslash (\) character. For example:

For Windows:

FILEA=\$\$fsserver1\mydata.dat

This resolves to $$fsserver1\mydata.dat

For UNIX:

FILEA=\$\$fsserver1/mydata.dat

This resolves to $$fsserver1/mydata.dat

Because of the function of the backslash (\) character as an escape character, if you want the value of an environment variable to be a UNC path (e.g. \\server\volume\directory\filename), be sure that it starts with four backslash characters - \\\\server\volume\directory\filename - rather than two. Each pair of backslash characters resolves to a single character, yielding the correct two-character sequence as a final result.