Recipes to bootstrap for things like ulimit etc

Are there any good bootstrap type recipes that you would want to run on all
servers.

I’m thinking things like changing the # of file descriptionts (ulimit) etc.

So we have a cookbook called "performance" which does a bunch of tweaks for us that we use. One of them for Ubuntu is set the pam.d/common-session and /etc/security/limits.conf. Its important you set it for both root and the user you wish to use the ulimit setting for.

the code looks like this:

template "/etc/security/limits.conf" do
source "limits.conf.erb"
owner "root"
group "root"
mode "0644"
variables(
:user => node[:ulimit][:user],
:soft => node[:ulimit][:soft],
:hard => node[:ulimit][:hard]
)
end

/etc/security/limits.conf
<%= @user %> soft nofile <%= @soft %>
<%= @user %> hard nofile <%= @hard %>

End of file

root soft nofile 64000
root hard nofile 65000

and you need to add common-session this:
session required pam_limits.so

I should oensource that cookbook.

Zuhaib
On May 13, 2012, at 4:37 AM, S Ahmed sahmed1020@gmail.com wrote:

Are there any good bootstrap type recipes that you would want to run on all servers.

I'm thinking things like changing the # of file descriptionts (ulimit) etc.