in chef/cookbooks/cpe_ulimit/resources/cpe_ulimit.rb [29:58]
def max_files
soft_limit = node['cpe_ulimit']['maxfiles_soft_limit']
hard_limit = node['cpe_ulimit']['maxfiles_hard_limit']
if soft_limit.nil? || hard_limit.nil?
Chef::Log.warn('cpe_ulimit maxfiles soft/hard limits not configured. ' \
'Skipping install')
else
max_files_hash = {
'Label' => node['cpe_launchd']['prefix'] + '.maxfiles',
'ProgramArguments' => [
'/bin/launchctl',
'limit',
'maxfiles',
soft_limit,
hard_limit,
],
'RunAtLoad' => true,
'ServiceIPC' => false,
}
node.default['cpe_launchd']['maxfiles'] = {
'plist_hash' => max_files_hash,
'type' => 'daemon',
}
end
end