Astorre
Astorre

Reputation: 75

meaning of failure_reset_period option in win32-service gem for Ruby

Creating new service with win32-service, what's the meaning of the failure_reset_period ?

I'll appreciate some words on other options too (failure_reboot_message, failure_command, failure_actions, failure_delay) and examples.

Thank you in advance.

Upvotes: 0

Views: 136

Answers (1)

Lluís
Lluís

Reputation: 1317

an example of use:

  Service.new(
    :service_name     => SERVICE_NAME,
    :display_name     => SERVICE_DISPLAYNAME,
    :start_type       => Service::AUTO_START,
    :error_control    => Service::ERROR_NORMAL,
    :service_type     => Service::WIN32_OWN_PROCESS,
    :description      => 'This service does blah blah..',
    :binary_path_name => path,
    :failure_reset_period => 86400, # period (in seconds) with no failures after which the failure count should be reset to 0
    :failure_actions      => [ Service::ACTION_RESTART ], # action to take
    :failure_delay        => 60000 # delay before action in milliseconds
  ) 

failure_reset_period resets to 0 the failure count on the service after specified time, what is useful since you can configure different actions for the first, second and other failures of the service.

meaning of those options is described here, for failure_reset_period:

the number of days that must pass before the service fail count is reset

Upvotes: 1

Related Questions