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

ulimit won't work if the current user doesnot have the limit higher or equal to 'rabbitmq' user #250

chrisduong opened this issue Apr 9, 2015 · 7 comments


None yet
7 participants
Copy link

commented Apr 9, 2015


I had been fighting to make rabbitmq get higher limit by specifing this attribute for 'rabbitmq' cookbook.
default['rabbitmq']['open_file_limit'] = 65536
However, because the nature of the inheritance of the ulimit. If the current user has lower limit than what rabbitmq user expect, even though he has 'sudo' privilege, it wouldn't work.
As it is said below,

The only way to make it work is to add ulimit at /etc/default/rabbitmq, not /etc/rabbitmq/rabbitmq-env.conf
so that the 'root' user would read '/etc/default/rabbitmq' and applied the expected limit so that 'rabbitmq' user later inherited it.

This might be 'rabbitmq' init script's fault or not !?


This comment has been minimized.

Copy link

commented Apr 21, 2015

another addition
currently the env file gets generated after the start of rabbit-mq - which is kind of not the right order.

@cmluciano cmluciano added the TODO label Apr 21, 2015


This comment has been minimized.

Copy link

commented Apr 22, 2015

Hi, I would like to update the fix.
It is involving of sudo module for pam. There is patch of /etc/pam.d/sudo in this ulimit cookbook to fix it


This comment has been minimized.

Copy link

commented Apr 22, 2015


This comment has been minimized.

Copy link

commented May 4, 2015

I closed as ulimit value in /etc/default/rabbitmq would completely fix it.

@chrisduong chrisduong closed this May 4, 2015


This comment has been minimized.

Copy link

commented May 26, 2015

Hi @jjasghar,

I have to reopen this, because I'm not sure how would you deal with ulimit at latest tag v4.0.0.
I can see that you keep both ulimit config in /etc/default/rabbitmq and /etc/rabbitmq/rabbitmq-env.conf. This is duplicated and can cause trouble. The code managed rabbitmq-env.conf is put ahead and make rabbitmq-server restart immediately, then would fail right away if there is no patched for /etc/pam.d/su in ulimit cookbook.

template "#{node['rabbitmq']['config']}.config" do
  sensitive true
  source 'rabbitmq.config.erb'
  cookbook node['rabbitmq']['config_template_cookbook']
  owner 'root'
  group 'root'
  mode 00644
    :kernel => format_kernel_parameters,
    :ssl_versions => (format_ssl_versions if node['rabbitmq']['ssl_versions']),
    :ssl_ciphers => (format_ssl_ciphers if node['rabbitmq']['ssl_ciphers'])
  notifies :restart, "service[#{node['rabbitmq']['service_name']}]", :immediately

We should manage ulimit in one place. Either in /etc/default/rabbitmq or /etc/rabbitmq/rabbitmq-env.conf.

@chrisduong chrisduong reopened this May 26, 2015


This comment has been minimized.

Copy link

commented Jun 30, 2015

This is indeed a problem. I am getting the following in my /var/log/rabbitmq/startup_err:

/usr/lib/rabbitmq/bin/rabbitmq-server: 12: ulimit: error setting limit (Operation not permitted)

If I remove the ulimit line manually from /etc/rabbitmq/rabbitmq-env.conf, then there is no issue.


This comment has been minimized.

Copy link

commented Jul 27, 2015

I have the same issue and agree with the previous comments: This should only be set once, preferable in the /etc/default/rabbitmq which controls how the service is started. I'd not expect ulimit to be useful in the /etc/rabbitmq/rabbitmq-env.conf which should only hold environmental vars.

Could this be updated since it's a blocked for us to upgrade to the otherwise great new version. We specifically want to use the additional configuration options now supplied via template to get rid of the template changes we added.

jordant added a commit to jordant/rabbitmq that referenced this issue Aug 6, 2015

removing ulimit from rabbitmq-env.conf
Issue related to this change is here


Setting ulimits for rabbitmq should be done in /etc/default
and not the rabbitmq-env file.

@jjasghar jjasghar closed this Aug 14, 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.