{"action":"created","issue":{"url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/250","labels_url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/250/comments","events_url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/250/events","html_url":"https://github.com/jjasghar/rabbitmq/issues/250","id":67271119,"number":250,"title":"ulimit won't work if the current user doesnot have the limit higher or equal to 'rabbitmq' user","user":{"login":"chrisduong","id":1848882,"avatar_url":"https://avatars.githubusercontent.com/u/1848882?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisduong","html_url":"https://github.com/chrisduong","followers_url":"https://api.github.com/users/chrisduong/followers","following_url":"https://api.github.com/users/chrisduong/following{/other_user}","gists_url":"https://api.github.com/users/chrisduong/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisduong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisduong/subscriptions","organizations_url":"https://api.github.com/users/chrisduong/orgs","repos_url":"https://api.github.com/users/chrisduong/repos","events_url":"https://api.github.com/users/chrisduong/events{/privacy}","received_events_url":"https://api.github.com/users/chrisduong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jjasghar/rabbitmq/labels/TODO","name":"TODO","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-09T03:18:16Z","updated_at":"2015-05-26T02:42:37Z","closed_at":null,"body":"Hi,\r\n\r\nI had been fighting to make rabbitmq get higher limit by specifing this attribute for 'rabbitmq' cookbook. \r\ndefault['rabbitmq']['open_file_limit'] = 65536\r\nHowever, 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.\r\nAs it is said below,  http://unix.stackexchange.com/questions/108603/do-changes-in-etc-security-limits-conf-require-a-reboot\r\n\r\nThe only way to make it work is to add ulimit at /etc/default/rabbitmq, not /etc/rabbitmq/rabbitmq-env.conf\r\nso that the 'root' user would read '/etc/default/rabbitmq' and applied the expected limit so that 'rabbitmq' user later inherited it.\r\n\r\nThis might be 'rabbitmq' init script's fault or not !?"},"comment":{"url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/comments/105367630","html_url":"https://github.com/jjasghar/rabbitmq/issues/250#issuecomment-105367630","issue_url":"https://api.github.com/repos/jjasghar/rabbitmq/issues/250","id":105367630,"user":{"login":"chrisduong","id":1848882,"avatar_url":"https://avatars.githubusercontent.com/u/1848882?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisduong","html_url":"https://github.com/chrisduong","followers_url":"https://api.github.com/users/chrisduong/followers","following_url":"https://api.github.com/users/chrisduong/following{/other_user}","gists_url":"https://api.github.com/users/chrisduong/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisduong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisduong/subscriptions","organizations_url":"https://api.github.com/users/chrisduong/orgs","repos_url":"https://api.github.com/users/chrisduong/repos","events_url":"https://api.github.com/users/chrisduong/events{/privacy}","received_events_url":"https://api.github.com/users/chrisduong/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T02:42:37Z","updated_at":"2015-05-26T02:42:37Z","body":"Hi @jjasghar,\r\n\r\nI have to reopen this, because I'm not sure how would you deal with ulimit at latest tag v4.0.0.\r\nI 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/sudo` in `ulimit` cookbook.\r\n```\r\ntemplate \"#{node['rabbitmq']['config']}.config\" do\r\n  sensitive true\r\n  source 'rabbitmq.config.erb'\r\n  cookbook node['rabbitmq']['config_template_cookbook']\r\n  owner 'root'\r\n  group 'root'\r\n  mode 00644\r\n  variables(\r\n    :kernel => format_kernel_parameters,\r\n    :ssl_versions => (format_ssl_versions if node['rabbitmq']['ssl_versions']),\r\n    :ssl_ciphers => (format_ssl_ciphers if node['rabbitmq']['ssl_ciphers'])\r\n  )\r\n  notifies :restart, \"service[#{node['rabbitmq']['service_name']}]\", :immediately\r\nend\r\n```\r\nWe should manage **ulimit** in one place. Either in **/etc/default/rabbitmq** or **/etc/rabbitmq/rabbitmq-env.conf**."}}