{"id":13781416,"url":"https://github.com/bmhatfield/chef-ulimit","last_synced_at":"2025-03-22T03:31:14.435Z","repository":{"id":5021918,"uuid":"6180650","full_name":"bmhatfield/chef-ulimit","owner":"bmhatfield","description":"This is a simple chef cookbook that provides a defintion for managing user_ulimit settings.","archived":false,"fork":false,"pushed_at":"2022-09-30T00:04:46.000Z","size":108,"stargazers_count":43,"open_issues_count":4,"forks_count":69,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-14T23:52:12.301Z","etag":null,"topics":["chef","cookbook","ulimit"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"FredrikNoren/ungit","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmhatfield.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-11T20:56:55.000Z","updated_at":"2025-02-24T11:02:27.000Z","dependencies_parsed_at":"2023-01-11T16:37:24.087Z","dependency_job_id":null,"html_url":"https://github.com/bmhatfield/chef-ulimit","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmhatfield%2Fchef-ulimit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmhatfield%2Fchef-ulimit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmhatfield%2Fchef-ulimit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmhatfield%2Fchef-ulimit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmhatfield","download_url":"https://codeload.github.com/bmhatfield/chef-ulimit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","cookbook","ulimit"],"created_at":"2024-08-03T18:01:25.806Z","updated_at":"2025-03-22T03:31:14.103Z","avatar_url":"https://github.com/bmhatfield.png","language":"Ruby","funding_links":[],"categories":["Resources"],"sub_categories":["User Management/Authorization"],"readme":"# ulimit Cookbook\n\n![delivery](https://github.com/bmhatfield/chef-ulimit/workflows/delivery/badge.svg?branch=master)\n[![Cookbook Version](https://img.shields.io/cookbook/v/ulimit.svg)](https://supermarket.chef.io/cookbooks/ulimit)\n\nThis cookbook provides resources for managing ulimits configuration on nodes.\n\n- `user_ulimit` resource for overriding various ulimit settings. It places configured templates into `/etc/security/limits.d/`, named for the user the ulimit applies to.\n- `ulimit_domain` which allows for configuring complex sets of rules beyond those supported by the user_ulimit resource.\n\nThe cookbook also includes a recipe (`default.rb`) which allows ulimit overrides with the 'su' command on Ubuntu.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu and derivatives\n- RHEL/Fedora and derivatives\n\n### Chef\n\n- Chef 12.7+\n\n### Cookbooks\n\n- none\n\n## Attributes\n\n- `node['ulimit']['pam_su_template_cookbook']` - Defaults to nil (current cookbook). Determines what cookbook the su pam.d template is taken from\n- `node['ulimit']['users']` - Defaults to empty Mash. List of users with their limits, as below.\n\n## Default Recipe\n\nInstead of using the user_ulimit resource directly you may define user ulimits via node attributes. The definition may be made via an environment file, a role file, or in a wrapper cookbook. Note: The preferred way to use this cookbook is by directly defining resources as it is much easier to troubleshoot and far more robust.\n\n### Example role configuration:\n\n```ruby\n\"default_attributes\": {\n   \"ulimit\": {\n      \"users\": {\n         \"tomcat\": {\n            \"filehandle_limit\": 8193,\n               \"process_limit\": 61504\n             },\n            \"hbase\": {\n               \"filehandle_limit\": 32768\n             }\n       }\n    }\n }\n```\n\nTo specify a change for all users change specify a wildcard resource or user name like so `user_ulimit \"*\"`\n\n## Resources\n\n### user_ulimit\n\nThe `user_ulimit` resource creates individual ulimit files that are installed into the `/etc/security/limits.d/` directory.\n\n#### Actions:\n\n- `create`\n- `delete`\n\n#### Properties\n\n- `username` - Optional property to set the username if the resource name itself is not the username. See the example below.\n- `filename` - Optional filename to use instead of naming the file based on the username\n- `filehandle_limit` -\n- `filehandle_soft_limit` -\n- `filehandle_hard_limit` -\n- `process_limit` -\n- `process_soft_limit` -\n- `process_hard_limit` -\n- `memory_limit` -\n- `virt_limit` -\n- `core_limit` -\n- `core_soft_limit` -\n- `core_hard_limit` -\n- `stack_soft_limit` -\n- `stack_hard_limit` -\n- `rtprio_limit` -\n- `rtprio_soft_limit` -\n- `rtprio_hard_limit` -\n\n#### Examples\n\nExample of a resource where the resource name is the username:\n\n```ruby\nuser_ulimit \"tomcat\" do\n  filehandle_limit 8192 # optional\n  filehandle_soft_limit 8192 # optional; not used if filehandle_limit is set)\n  filehandle_hard_limit 8192 # optional; not used if filehandle_limit is set)\n  process_limit 61504 # optional\n  process_soft_limit 61504 # optional; not used if process_limit is set)\n  process_hard_limit 61504 # optional; not used if process_limit is set)\n  memory_limit 1024 # optional\n  core_limit 2048 # optional\n  core_soft_limit 1024 # optional\n  core_hard_limit 'unlimited' # optional\n  stack_soft_limit 2048 # optional\n  stack_hard_limit 2048 # optional\n  rtprio_limit 60 # optional\n  rtprio_soft_limit 60 # optional\n  rtprio_hard_limit 60 # optional\nend\n```\n\nExample where the resource name is not the username:\n\n```ruby\nuser_ulimit 'set filehandle ulimits for our tomcat user' do\n  username 'tomcat'\n  filehandle_soft_limit 8192\n  filehandle_hard_limit 8192\nend\n```\n\n### ulimit_domain\n\nNote: The `ulimit_domain` resource creates files named after the domain with no modifiers by default. To override this behavior, specify the `filename` parameter to the resource.\n\n#### Actions:\n\n- `create`\n- `delete`\n\n#### Examples:\n\n```ruby\nulimit_domain 'my_user' do\n  rule do\n    item :nofile\n    type :hard\n    value 10000\n  end\n  rule do\n    item :nofile\n    type :soft\n    value 5000\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmhatfield%2Fchef-ulimit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmhatfield%2Fchef-ulimit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmhatfield%2Fchef-ulimit/lists"}