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

Commit 304e328

Browse files
committed
Merge branch 'pr/380'
2 parents 9ff27cf + 74f58d3 commit 304e328

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

.rubocop.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ Style/WordArray:
4444
MinSize: 5
4545

4646
Style/RedundantBegin:
47-
Enabled: false
47+
Enabled: false
48+
49+
# Offense count: 2
50+
# Cop supports --auto-correct.
51+
Style/NumericLiterals:
52+
MinDigits: 6

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 0.11.1
44
* MINOR - default logstash version 1.4.2
55
* MINOR - correct status code for initv scripts
6+
* MINOR - parameterize open file limits for upstart method
67

78
## 0.11.0
89
* MAJOR - depreciate non runit service types.

attributes/default.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
default['logstash']['instance_default']['runit_run_template_name'] = 'logstash'
6363
default['logstash']['instance_default']['runit_log_template_name'] = 'logstash'
6464

65+
default['logstash']['instance_default']['limit_nofile_soft'] = 65550
66+
default['logstash']['instance_default']['limit_nofile_hard'] = 65550
67+
6568
# roles/flags for various autoconfig/discovery components
6669
default['logstash']['instance_default']['enable_embedded_es'] = false
6770
default['logstash']['instance_default']['bind_host_interface'] = ''

metadata.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
license 'Apache 2.0'
66
description 'Installs/Configures logstash'
77
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
8+
89
version '0.11.1'
910

1011
%w(ubuntu debian redhat centos scientific amazon fedora).each do |os|

providers/service.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def load_current_resource
3434
@supervisor_gid = Logstash.get_attribute_or_default(node, @instance, 'supervisor_gid')
3535
@runit_run_template_name = Logstash.get_attribute_or_default(node, @instance, 'runit_run_template_name')
3636
@runit_log_template_name = Logstash.get_attribute_or_default(node, @instance, 'runit_log_template_name')
37+
@nofile_soft = Logstash.get_attribute_or_default(node, @instance, 'limit_nofile_soft')
38+
@nofile_hard = Logstash.get_attribute_or_default(node, @instance, 'limit_nofile_hard')
3739
end
3840

3941
action :restart do
@@ -112,7 +114,9 @@ def load_current_resource
112114
log_file: svc[:log_file],
113115
workers: svc[:workers],
114116
supervisor_gid: svc[:supervisor_gid],
115-
upstart_with_sudo: svc[:upstart_with_sudo]
117+
upstart_with_sudo: svc[:upstart_with_sudo],
118+
nofile_soft: svc[:nofile_soft],
119+
nofile_hard: svc[:nofile_hard]
116120
)
117121
notifies :restart, "service[#{svc[:service_name]}]", :delayed
118122
end
@@ -247,7 +251,9 @@ def svc_vars
247251
supervisor_gid: @supervisor_gid,
248252
templates_cookbook: @templates_cookbook,
249253
runit_run_template_name: @runit_run_template_name,
250-
runit_log_template_name: @runit_log_template_name
254+
runit_log_template_name: @runit_log_template_name,
255+
nofile_soft: @nofile_soft,
256+
nofile_hard: @nofile_hard
251257
}
252258
svc
253259
end

templates/default/init/upstart/tarball.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stop on runlevel [!2345]
66

77
respawn
88
respawn limit 5 30
9-
limit nofile 65550 65550
9+
limit nofile <%= @nofile_soft %> <%= @nofile_hard %>
1010

1111
chdir <%= @home %>
1212

0 commit comments

Comments
 (0)