elasticsearch/cookbook-elasticsearch — pull request #118 by ctrabold (2013-07-30 22:37:31+00:00)
Title: Replaces `bash` with `file` resource to adjust file descriptor limits via `limits.d`

While reading the recommendations found [here](http://asquera.de/opensource/2012/11/25/elasticsearch-pre-flight-checklist/#file-descriptors) I thought that it would be a good idea to use `limits.d` instead of hacking the `limits.conf` file directly.

This way Chef handles the idempotency itself and we can drop the custom (and hard to read) `not_if` magic.

The result is the following file:

# cat /etc/security/limits.d/10-elasticsearch.conf
elasticsearch - nofile 4000
elasticsearch - memlock unlimited

Tested on Vagrant with Debian 6 by removing the two lines from `/etc/security/limits.conf` and restarting the machine.

Calling `ulimit -Hn` showed the expected value.