Shutdown service (coreServices2)

Provide access through PPS communication to a variety of services, including shutdown.

Syntax:

coreServices2 [-r path] [-U UID:GIG] [-S UID:GIG] [-M UID:GIG]
[-l none|module[,module]*] [-v]* [-d] [-C
    configuration file] 

Runs on:

QNX Neutrino

Options:

-r path
Specify the root path to the PPS service. Default is /pps/services.
-U
The username or the UID:GID,GID specifying the user and group IDs of the main server process.
-S
The username or the UID:GID,GID specifying the user and group IDs of the spawner process.
-M
The username or the UID:GID,GID specifying the user and group IDs of the monitor process.
-l none|module[,module]*
If specified, use this list of dynamic modules instead of the dynamic modules listed in the configuration file.
-d
Run in foreground instead of as a daemon (default).
-v
Set verbosity of output to sloginfo.
-C filename
The filepath and filename of the configuration file.

Description:

The coreServices2 utility provides a single point from which to ask the system to run a variety of services. It handles the house-keeping, while communication is through PPS. This design means that the requesting component or application only needs to publish and subscribe to the relevant PPS objects.

The QNX CAR platform uses coreServices2 to provide access from the HMI to the shutdown service.

coreServices2 objects

The coreServices2 service maintains an object for every service to which it gives access. Each object represents a single service. An object may be static (compiled into the coreServices binary) or dynamic (loaded through dlopen() at runtime).

Most basic services are static, but some services that are large (or that require large shared libraries) and are not needed by all implementations are made available as dynamic modules.

In the QNX CAR platform, coreServices2 maintains the following statically loaded object:

shutdown
Shut down and reboot the system. See shutdown.

In the QNX CAR platform, coreServices2 doesn't use any dynamically loaded modules.

PPS objects

The coreServices2 service publishes or subscribes to the following PPS object:

Configuration file

A configuration file specifies the core services that will be used. The name and location of the file is specified by the -C. In the QNX CAR platform, the configuration file is located at /etc/system/config/coreServices2.json.

The file is a plain-text file built using the following syntax:
 
{
"static_modules" : comma separated string of static module names
"dynamic_modules" : comma separated string of dynamic module names 
"disable_procmon" :  Boolean: true|false
"disable_hwid" : Boolean: true|false
}
For example, the configuration file at the time of writing includes only the shutdown service, which is a static module:
{
"static_modules" : "shutdown",
"dynamic_modules" : "",
"disable_procmon" : true,
"disable_hwid" : true
}