Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
parameterize open file limit for upstart methods
Browse files Browse the repository at this point in the history
  • Loading branch information
akerekes committed Dec 5, 2014
1 parent 2e01144 commit 74f58d3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
default['logstash']['instance_default']['init_method'] = 'native' # pleaserun or native or runit
default['logstash']['instance_default']['service_templates_cookbook'] = 'logstash'

default['logstash']['instance_default']['limit_nofile_soft'] = 65550
default['logstash']['instance_default']['limit_nofile_hard'] = 65550

# roles/flags for various autoconfig/discovery components
default['logstash']['instance_default']['enable_embedded_es'] = false
default['logstash']['instance_default']['bind_host_interface'] = ''
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
license 'Apache 2.0'
description 'Installs/Configures logstash'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.10.0'
version '0.10.3'

%w(ubuntu debian redhat centos scientific amazon fedora).each do |os|
supports os
Expand Down
10 changes: 8 additions & 2 deletions providers/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def load_current_resource
@debug = Logstash.get_attribute_or_default(node, @instance, 'debug')
@install_type = Logstash.get_attribute_or_default(node, @instance, 'install_type')
@supervisor_gid = Logstash.get_attribute_or_default(node, @instance, 'supervisor_gid')
@nofile_soft = Logstash.get_attribute_or_default(node, @instance, 'limit_nofile_soft')
@nofile_hard = Logstash.get_attribute_or_default(node, @instance, 'limit_nofile_hard')
end

use_inline_resources
Expand Down Expand Up @@ -121,7 +123,9 @@ def load_current_resource
debug: svc[:debug],
log_file: svc[:log_file],
workers: svc[:workers],
supervisor_gid: svc[:supervisor_gid]
supervisor_gid: svc[:supervisor_gid],
nofile_soft: svc[:nofile_soft],
nofile_hard: svc[:nofile_hard]
)
notifies :restart, "service[#{svc[:service_name]}]", :delayed
end
Expand Down Expand Up @@ -251,7 +255,9 @@ def svc_vars
debug: @debug,
install_type: @install_type,
supervisor_gid: @supervisor_gid,
templates_cookbook: @templates_cookbook
templates_cookbook: @templates_cookbook,
nofile_soft: @nofile_soft,
nofile_hard: @nofile_hard
}
svc
end
2 changes: 1 addition & 1 deletion templates/default/init/upstart/java.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stop on runlevel [!2345]

respawn
respawn limit 5 30
limit nofile 65550 65550
limit nofile <%= @nofile_soft %> <%= @nofile_hard %>

chdir <%= @home %>

Expand Down
2 changes: 1 addition & 1 deletion templates/default/init/upstart/tarball.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stop on runlevel [!2345]

respawn
respawn limit 5 30
limit nofile 65550 65550
limit nofile <%= @nofile_soft %> <%= @nofile_hard %>

chdir <%= @home %>

Expand Down

0 comments on commit 74f58d3

Please sign in to comment.