The Lifecycle Tab provides the service options related to the lifecycle of the service.



The following table describes the fields provided on the Lifecycle page.


FieldsDescription
Service Lifecycle
Upon Program Exit

This option provides granular restart control if the program terminates intentionally or unexpectedly. 


The following options are available:

  • Ignore: Monitoring is disabled, and no reporting is performed.

  • Restart Program: Attempt to restart the program. These attempts are noted in the Event Log.

  • Terminate FireDaemon service: The service will terminate immediately (hard exit). Any After-Termination event programs will be executed. Any actions specified in the Recovery tab will be initiated (by the Service Control Manager).

  • Stop FireDaemon service: The service will stop gracefully. Any After-Termination event programs will be executed.

  • Report the Termination (no restart): The failure will simply be noted in the Event Log.

  • Reboot: The computer will be rebooted.

  • Retry on regular failures, Complete on success: If the program exits successfully (exit code 0), the service will stop gracefully. If the program suffers a "regular" failure (not a crash), it will be restarted. If the program crashes, the service will terminate immediately. (A crash is any exit code of 0x40000000 or higher, except for 0xc000013a [STATUS_CONTROL_C_EXIT]).

  • Retry on regular+unexpected failures, Complete on success: If the program exits successfully (exit code 0), the service will stop gracefully. If the program fails for any reason (non-zero exit code), it will be restarted.
Flap DetectionThis sets an upper limit to the number of restarts that FireDaemon Pro will perform during the program's startup phase.

Flaps are noted in the Debug log. If the upper limit is reached, FireDaemon will take action according to the setting selected from the following list:

  • Terminate Program after: FireDaemon Pro will continue to run, but no further restarts are performed. The restart count will be reset to zero if the service is restarted manually or as a part of a scheduled restart.

  • Terminate FireDaemon service after: The service will terminate immediately (hard exit). Any After-Termination event programs will be executed. Any actions specified in the Recovery tab will be initiated (by the Service Control Manager)..

  • Stop FireDaemon service after: The service will stop gracefully. Any After-Termination event programs will be executed.

  • Stop FireDaemon service, unless scheduled, after: Stops the FireDaemon Pro service unless the program is scheduled to run again at some time in the future.

  • retries: This setting specifies the upper limit on the number of restarts. This value is reset to zero at each scheduled restart or duration. The minimum value is 0. The maximum value is 1000.

Note: Flap Detection is only applicable when a program is initially launched. Flap Detection is deactivated once the program has been launched successfully, a PID has been assigned, and the program has been running stably for a period greater than the Monitoring Interval.

Note: This field is enabled only when an option related to restarting is selected in the Upon Program Exit field.

For details about which Event programs are executed in various launch and termination scenarios, refer to FireDaemon Pro Events and Triggering Points
Fail DetectionThis sets an upper limit to the number of restarts that FireDaemon Pro will perform during the entire lifecycle of the program.

Fails are noted in the Debug log. If the upper limit is reached, FireDaemon will take action according to the setting selected from the following list:
  • Disabled: No action is taken.

  • Terminate Program after: FireDaemon Pro will continue to run, but no further restarts are performed. The restart count will be reset to zero if the service is restarted manually or as part of a scheduled restart.

  • Terminate FireDaemon service after: The service will terminate immediately (hard exit). Any After-Termination event programs will be executed. Any actions specified in the Recovery tab will be initiated (by the Service Control Manager)..

  • Stop FireDaemon service after: The service will stop gracefully. Any After-Termination event programs will be executed.

  • Stop FireDaemon service, unless scheduled, after: Stops the FireDaemon Pro service unless the program is scheduled to run again at some time in the future.

  • retries: If Fail Detection is enabled, this setting specifies the upper limit on the number of restarts. This value is reset to zero at each scheduled restart or duration.

Note: Fail Detection is only applicable when a program is successfully launched. Fail Detection is activated only when Flap Detection has been deactivated. For more information about Flap Detection, see the Flap Detection field.

Note: This field is enabled only when an option related to restarting is selected in the Upon Program Exit field.

For details about which Event programs are executed in various launch and termination scenarios, refer to FireDaemon Pro Events and Triggering Points
Freeze Detection

This controls how FireDaemon Pro responds when the program freezes (hangs). Freeze Detection is only relevant when the program running under FireDaemon Pro control has a GUI. A program will freeze when the program's primary message event loop becomes unresponsive. FireDaemon Pro uses the IsHungAppWindow to detected freezes.


The following options are available:
  • Disabled: Freeze detection checking is not performed.

  • Report: A freeze condition is recorded in the Window Event Log and Debug Log. No other action is taken.

  • Terminate Program (=> lifecycle), after: A freeze condition is handled by terminating the program. Following termination, the action configured in Upon Program Exit is executed.

  • minutes: If a program is continuously unresponsive for this number of minutes, it is treated as frozen and terminated. This setting only applies to the Terminate action above.


For details about which Event programs are executed in various launch and termination scenarios, refer to FireDaemon Pro Events and Triggering Points

 Shutdown ByThis controls how FireDaemon Pro shuts down the program.

The following options are available:
  • Forceful Termination: FireDaemon Pro will unconditionally terminate the program after the specified Shutdown Delay (in milliseconds) has elapsed.

    FireDaemon Pro terminates the program by calling the TerminateProcess API, which only requests the cancellation of pending I/O.

  • Induced Exit: This is less brutal than 'Forceful Termination'. This option allows the program to perform basic cleanup operations before terminating itself.

    FireDaemon Pro induces the program to exit by calling the ExitProcess API, which for example, closes Operating System handles.

  • Graceful Close: FireDaemon Pro will gracefully close the program.

    For console-based programs, the CTRL_BREAK_EVENT or CTRL_C_EVENT message is sent to the programs' console (based on the Close Console By option selected for the Console Program field).

    For interactive GUI-based programs, a single WM_CLOSE message is sent to the top-level window of the program. FireDaemon Pro then attempts to intelligently detect any popup windows that might result and send messages in the following order in an attempt to close them (IDCANCEL, IDABORT, IDOK, IDNO, IDYES).


    The Graceful Close method is overridden if you create a Termination Event with the Disposition of Send Close.

If the program does not close of its own accord, it will be terminated after the time specified in the Max Shutdown Delay field has elapsed.

Under specific circumstances, the sub-process' exit code is returned to the Service Control Manager (SCM). This may result in an error message being displayed in the Windows Event Log by the SCM containing the exit code. The circumstances under which the exit code is returned is as follows:

  • The program’s exit code is propagated if the FireDaemon Pro service is terminated. The FireDaemon Pro service will be terminated with the program’s exit code if one of the lifecycle options “Upon Program Exit”, “Flap Detection”, “Fail Detection” is set to “Terminate FireDaemon Service (after)” or “Terminate FireDaemon Service, unless scheduled, after”, or if “Upon Program Exit” is set to “Retry on regular failures, Complete on success” and the program crashes.
  • If the FireDaemon Pro service should be stopped according to lifecycle options and the program exits with an error code other than success (i.e. 0) then the Windows error code 1066 [ERROR_SERVICE_SPECIFIC_ERROR] gets reported to the SCM. The FireDaemon Pro service will be stopped if one of the lifecycle options “Upon Program Exit”, “Flap Detection”, “Fail Detection” is set to “Stop FireDaemon Service (after)” or “Stop FireDaemon Service, unless scheduled, after”.
Maximum Shutdown DelayThis is the maximum time (in milliseconds) that FireDaemon Pro will wait for the program to shut down after initiating the Induced Exit or Graceful Close shutdown option selected in the Shutdown By field.

FireDaemon will send the graceful shutdown message. However, if the program is still running, FireDaemon Pro will forcibly terminate it.
Console ProgramSelect this checkbox if the service is a Win32 console program. Examples include Java, Perl, and 3rd party Win32 applications. Enabling this feature will disable Freeze Detection.

Selecting this option causes the console control handler to be wrapped around the program.
Close Console ByThis option determines whether a Ctrl+Break message or a Ctrl+C message will be sent to the console program when performing a Graceful Close shutdown action.
Pre-Shutdown
Pre-Shutdown[Windows Vista, Windows Server 2008 or later only] 

If enabled, FireDaemon Pro will register the service to receive pre-shutdown notifications.

During a system shutdown or reboot, services have approximately 20 seconds to shut down. However, if certain services require more time to terminate or shut down, this option can help FireDaemon Pro to gracefully shut down these services.
Pre-Shutdown DelayThis is the amount of time (in milliseconds) that the Windows Service Control Manager (SCM) will wait for the service to terminate.

The default time is 180000 milliseconds (3 minutes).

Note that the Windows SCM has an overriding limit on pre-shutdown delays, so an unduly large delay value may not be honoured during a shutdown.
Shutdown Order List InclusionSelect this checkbox to include the service in the global list of Pre-Shutdown services. You can reorder the list by using the UP and DOWN arrows below the list.

This field is enabled only when the Pre-Shutdown checkbox is selected.