WatchdogApp

Watchdog Application Configuration

The N2SVCD Watchdog Application is a special case application.

Note that the WatchdogApp is quite distinct from the ManageApp:

The following configuration is used to create a Watchdog Application instance. If you omit this section, a default Watchdog Application will be created.

<?xml version="1.0" encoding="utf-8"?>
<n2svcd>
  ...
  <applications>
    ...
    <application name="Watchdog" module="WatchdogApp">
      <include><lib>../apps/watchdog/lib</lib></include>
      <parameters>
        <parameter name="shutdown_notice_secs" value="4"/>
        <parameter name="termination_notice_ms" value="500"/>
        <parameter name="heartbeat_interval_secs" value="120"/>
        <parameter name="heartbeat_response_ms" value="900"/>
      </parameters>
    </application>
    ...
  </application>
  ...
</n2svcd>

Configuration Details

The application element attributes for a Watchdog Application instance may include the below.

For details of the various parameter types used, refer to Common Configuration.

Parameter Name Type XML Type Description
See: Common Application configuration
module String Attribute [Required] WatchdogApp
include.lib String Attribute [Required] ../apps/watchdog/lib
parameters Array Element [Required] As per Common Configuration Application parameters.
"edr_enabled" - - This value is ignored; the Watchdog Application does not support writing EDRs.
"shutdown_notice_secs" Integer Attribute Number of seconds from Shutdown Notice until actual Shutdown.
(Default = 2)
"termination_notice_ms" Integer Attribute Number of milliseconds from Shutdown until process Termination.
(Default = 500)
"heartbeat_interval_secs" Integer Attribute Number of seconds between application heartbeats. Set to 0 to disable heartbeats.
(Default = 30)
"heartbeat_response_ms" Integer Attribute Number of milliseconds before an application Heartbeat Response is considered overdue.
(Default = 1000)
"overdue_to_terminate_secs" Integer Attribute When a heartbeat response is overdue, the watchdog immediately generates a warning message and then begins checking to see if the application sub-process has died. If, after this number of seconds, the overdue application sub-process has not died, then watchdog will actively terminate the application subprocess using the TERM signal.
(Default = 3)
"terminated_to_killed_secs" Integer Attribute After sending the TERM signal, the watching process will continue to monitor to check to see if the application sub-process has died. If, after this number of seconds, the overdue application sub-process has not died, then watchdog will actively kill the application subprocess using the KILL signal, and then will wait indefinitely until the sub-process dies.
(Default = 3)
"restart_retry_secs" Integer Attribute After the overdue application sub-process has died, then the watchdog process will immediately restart a new application sub-process. If this restart fails, the application will repeatedly attempt to restart the process each this number of seconds. Minimum value is 1.
(Default = 30)

Message Handling

In addition to the common Application management messages, the WatchdogApp uses the following messages: