Skip to content

Commit

Permalink
Allow configuration of the init MAX_TIMEOUT
Browse files Browse the repository at this point in the history
If you have a long complex sensu check that can take more than
10 seconds the sensu client might fail to restart.

This can cause problems in automated build environments.

This commit allows you to configure this parameter of the init
script by setting it in /etc/default/sensu.
  • Loading branch information
whpearson committed Mar 20, 2015
1 parent dceeee5 commit b140c7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@
# Default: 'info'
# Valid values: debug, info, warn, error, fatal
#
# [*init_stop_max_wait*]
# Integer. Number of seconds to wait for the init stop script to run
# Default: 10
#
class sensu (
$version = 'latest',
$sensu_plugin_name = 'sensu-plugin',
Expand Down Expand Up @@ -261,6 +265,7 @@
$gem_path = '',
$log_level = 'info',
$dashboard = false,
$init_stop_max_wait = 10,
){

validate_bool($client, $server, $api, $install_repo, $purge_config, $safe_mode, $manage_services, $rabbitmq_reconnect_on_error, $redis_reconnect_on_error)
Expand All @@ -272,6 +277,7 @@
if !is_integer($rabbitmq_port) { fail('rabbitmq_port must be an integer') }
if !is_integer($redis_port) { fail('redis_port must be an integer') }
if !is_integer($api_port) { fail('api_port must be an integer') }
if !is_integer($init_stop_max_wait) { fail('init_stop_max_wait must be an integer') }
if $dashboard { fail('Sensu-dashboard is deprecated, use a dashboard module. See https://github.com/sensu/sensu-puppet#dashboards')}

# Ugly hack for notifications, better way?
Expand Down
1 change: 1 addition & 0 deletions templates/sensu.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ EMBEDDED_RUBY=<%= scope.lookupvar("sensu::use_embedded_ruby") %>
LOG_LEVEL=<%= scope.lookupvar("sensu::log_level") %>
RUBYOPT="<%= scope.lookupvar("sensu::rubyopt") %>"
GEM_PATH="<%= scope.lookupvar("sensu::gem_path") %>"
SERVICE_MAX_WAIT="<%= scope.lookupvar("sensu::init_stop_timeout_length") %>"

0 comments on commit b140c7d

Please sign in to comment.