Skip to content

Commit

Permalink
Merge pull request #199 from darron/master
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbellone committed Jul 24, 2015
2 parents 422db02 + 72d59a9 commit 677a958
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
"server" => 8300,
}

# Ubuntu Upstart Open Files Limit
default['consul']['files_soft_limit'] = 2048
default['consul']['files_hard_limit'] = 4096

# Consul DataBag
default['consul']['data_bag'] = 'consul'
default['consul']['data_bag_encrypt_item'] = 'encrypt'
Expand Down
4 changes: 3 additions & 1 deletion recipes/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@
mode init_mode
variables(
consul_logfile: node['consul']['logfile'],
startup_sleep: node['consul']['startup_sleep']
startup_sleep: node['consul']['startup_sleep'],
soft_limit: node['consul']['files_soft_limit'],
hard_limit: node['consul']['files_hard_limit']
)
notifies :restart, 'service[consul]', :immediately
end
Expand Down
3 changes: 3 additions & 0 deletions templates/default/consul.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ emits consul-up
start on runlevel [2345]
stop on runlevel [!2345]

# set max open files
limit nofile <%= @soft_limit %> <%= @hard_limit %>

script
if [ -f <%= node['consul']['etc_config_dir'] %> ]; then
. <%= node['consul']['etc_config_dir'] %>
Expand Down

0 comments on commit 677a958

Please sign in to comment.