Skip to content

Commit

Permalink
Properly set FD_LIMIT in sysv init when install from package
Browse files Browse the repository at this point in the history
The default['cassandra']['limits']['nofile'] attribute is not used when
installing from a package. This change runs a simple sed command to
replace the existing value with the value specified in the attribute.
  • Loading branch information
richid committed Jul 23, 2015
1 parent e90922f commit 62199c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/datastax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
options '--force-yes -o Dpkg::Options::="--force-confold"'
# giving C* some time to start up
notifies :run, 'ruby_block[sleep30s]', :immediately
notifies :run, 'execute[set_fd_limit]', :immediately
notifies :run, 'execute[set_cluster_name]', :immediately
end

Expand All @@ -100,6 +101,12 @@
action :nothing
end

execute 'set_fd_limit' do
command "sed -i -e 's/^FD_LIMIT=.*$/FD_LIMIT=#{node['cassandra']['limits']['nofile']}/' /etc/init.d/#{node['cassandra']['service_name']}"
notifies :restart, 'service[cassandra]', :delayed
action :nothing
end

execute 'set_cluster_name' do
command "/usr/bin/cqlsh -e \"update system.local set cluster_name='#{node['cassandra']['cluster_name']}' where key='local';\"; /usr/bin/nodetool flush;"
notifies :restart, 'service[cassandra]', :delayed
Expand Down

0 comments on commit 62199c1

Please sign in to comment.