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

Comments

Projects
None yet
2 participants
@kamaradclimber
Copy link

commented Jun 25, 2013

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

This comment has been minimized.

Copy link
Member

commented Jun 25, 2013

@karmi

This comment has been minimized.

Copy link
Member

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 in 3043d7d Aug 1, 2013

karmi added a commit that referenced this issue Aug 1, 2013

thoughtcroft pushed a commit to ninefold/chef-elasticsearch that referenced this issue Jan 30, 2015

Replaced `bash` with `file` resource when setting the limits
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 elastic#101
Closes elastic#118

Fixes elastic#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
You can’t perform that action at this time.