Defining services in the process agent configuration file
Within the process agent configuration file, you can define services to group together related processes, and configure interdependencies of processes. The processes must already be defined in the list of processes within the file.
Service definition example
An example service definition in the $NCHOME/omnibus/etc/nco_pa.conf configuration file is as follows:
nco_service 'Omnibus'
{
ServiceType = Master
ServiceStart = Non-Auto
process 'ObjectServer' NONE
process 'Proxy' 'ObjectServer'
process 'Probe' 'Proxy'
process 'Probe-1' 'ObjectServer'
process 'Sleep' 5
}
Service definition description
The following table uses the preceding example to describe the service definition information contained in the configuration file.
Configuration information | Description |
---|---|
nco_service 'Omnibus' |
Defines the name of the service (for example, Omnibus). Note: Each service name must be unique within the process control
network.
|
ServiceType |
Defines whether this service should be started before all other services and handled as the master service upon which other services depend. This can be set as either Master or Non-Master. |
ServiceStart |
This can be set to Auto to start the service as soon as nco_pad has started, and Non-Auto if the service must be started manually with the nco_pa_start command. |
process |
Each process entry defines a process that must
be run as part of the service. You can indicate process dependencies
so that a process cannot start before another is already running. Note: You must include a process only once within any of the
service definitions in the configuration file.
|
Specifying process dependencies
When defining a service, you can use the process attribute to define the processes that should be run as part of the service. You can add dependencies on each of the processes in the service. The format of the process attribute is as follows:
process 'processname' dependency
In this attribute, processname is the name of the process defined in the list of processes and dependency can be a numeric value, a string value, or NONE.
If dependency is a number, it indicates a time dependency, in seconds, for starting the dependent process. A time dependency is always measured from the start of the service. For example, if you enter 5, the process starts five seconds after the service has started.
If dependency is a string, it indicates another PA aware process in the same service.
The dependency type NONE specifies no dependency.
In the preceding service definition example for
the Omnibus
service, the ObjectServer
process
starts first because it has no dependencies. Five seconds after the
ObjectServer starts, the Sleep
process starts. When
the ObjectServer is running successfully, Proxy
and Probe-1
start.
When the proxy server is running, the Probe
process
starts. If any of the processes was specified as dependent on the
time-dependent Sleep
process, that process does not
start, and is assigned a status of DEAD.