The System Health Manager (SHMA) was previously known as the System Monitor (SysMon). It monitors running processes (system servers) and attempts to restart them if they fail unexpectedly. It may restart the device if it is unable to restart the process.
A application may use the SysMon API to request monitoring for itself or other applications. Only an application with ProtServ capability, however, may request that the device be restarted.
Certain applications and background process are essential for the device or for certain applications to function correctly. The System Health Manager ensures that the device remains completely functional by restarting applications or processes, or the device itself, if they stop unexpectedly.
SHMA uses System State Manager (SSM) for process monitoring. SSM provides the required information such as number of restart attempts that can be made, start-up modes and properties. See System State Manager.
Specifies the behaviour when a process fails unexpectedly. See Relaunch policy.
Specifies the behaviour when a failed process fails to restart. See Retry Failure policy.
The SHMA is simple and self explanatory. A client must instantiate an RSysMonSession to open a session for monitoring.
Monitoring is started with a call to RSysMonSession::MonitorL() or RSysMonSession::MonitorSelfL(). Before calling one of these functions, however, the client must create and populate a CSsmStartupProperties object containing the required monitoring and restart configurations. CSsmStartupProperties has a series of Set...() functions which are used to determine the monitoring and restart behaviour for the process to be monitored.
Process monitoring can also be set up using a resource file. CResourceFile accesses a resource file and reads the resource data into a buffer and the data is interpreted using RResourceReader class.
Process monitoring is normally configured for processes using SSM_START_PROCESS_INFO and SSM_START_APP_INFO resources in a static command list. These are defined in ssmcmd.rh. Note that these structures add monitor, startup mode and a localisable error message to SSM_START_PROCESS_INFO and SSM_START_APP_INFO. See Examples.
SysMon API has the following classes:
System Health Manager is used for requesting and cancelling monitoring for a process.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.