Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing nofile attribute is not idempotent #101

Closed
kamaradclimber opened this issue Jun 25, 2013 · 2 comments
Closed

Changing nofile attribute is not idempotent #101

kamaradclimber opened this issue Jun 25, 2013 · 2 comments

Comments

@kamaradclimber
Copy link

Changing the nofile attribute leads to duplicate line in /etc/security/limits.conf such as:

elasticsearch     -    nofile    1024
elasticsearch     -    memlock   512
elasticsearch     -    nofile    20000
elasticsearch     -    memlock   512
@karmi
Copy link
Contributor

karmi commented Jun 25, 2013

@karmi
Copy link
Contributor

karmi commented Jun 25, 2013

@kamaradclimber Actually not strange at all -- the not_if block works only with the updated values. The code would have been much more robust (ie. create or update the lines) to be truly idempotent.

kamaradclimber added a commit to kamaradclimber/cookbook-elasticsearch that referenced this issue Jun 25, 2013
kamaradclimber added a commit to kamaradclimber/cookbook-elasticsearch that referenced this issue Jun 25, 2013
kamaradclimber added a commit to kamaradclimber/cookbook-elasticsearch that referenced this issue Jun 25, 2013
kamaradclimber added a commit to kamaradclimber/cookbook-elasticsearch that referenced this issue Jun 28, 2013
@karmi karmi closed this as completed in 3043d7d Aug 1, 2013
karmi pushed a commit that referenced this issue Aug 1, 2013
thoughtcroft pushed a commit to ninefold/chef-elasticsearch that referenced this issue Jan 30, 2015
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 "chef-ulimit" cookbook uses the same approach: https://github.com/bmhatfield/chef-ulimit/blob/master/definitions/user_ulimit.rb#L13

Tested on Vagrant with Debian 6 and Ubuntu Precise.

Closes sous-chefs#101
Closes sous-chefs#118

Fixes sous-chefs#102
thoughtcroft pushed a commit to ninefold/chef-elasticsearch that referenced this issue Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants