summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-20 09:31:19 -0700
committerTim Smith <tsmith84@gmail.com>2020-03-20 09:31:19 -0700
commit548b7213361c1e19bc06a22efa1944a2e0884e54 (patch)
tree53694aa82adb1f15f84d3231155892fbedde19be
parentaf87e78c46b1676ebfab6422c01651273d0f7362 (diff)
downloadchef-548b7213361c1e19bc06a22efa1944a2e0884e54.tar.gz
Fix loading the template file in the user_ulimit resource
Also test it in the kitchen tests. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/default.rb15
-rw-r--r--lib/chef/resource/user_ulimit.rb1
2 files changed, 16 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
index eeccb9ffd7..8003f915f8 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb
@@ -117,6 +117,21 @@ end
end
end
+user_ulimit "tomcat" do
+ filehandle_soft_limit 8192
+ filehandle_hard_limit 8192
+ process_soft_limit 61504
+ process_hard_limit 61504
+ memory_limit 1024
+ core_limit 2048
+ core_soft_limit 1024
+ core_hard_limit "unlimited"
+ stack_soft_limit 2048
+ stack_hard_limit 2048
+ rtprio_soft_limit 60
+ rtprio_hard_limit 60
+end
+
include_recipe "::chef-vault" unless includes_recipe?("end_to_end::chef-vault")
include_recipe "::alternatives"
include_recipe "::tests"
diff --git a/lib/chef/resource/user_ulimit.rb b/lib/chef/resource/user_ulimit.rb
index 82be09cf74..df3a3dee4e 100644
--- a/lib/chef/resource/user_ulimit.rb
+++ b/lib/chef/resource/user_ulimit.rb
@@ -79,6 +79,7 @@ class Chef
action :create do
template "/etc/security/limits.d/#{new_resource.filename}" do
source ::File.expand_path("../support/ulimit.erb", __FILE__)
+ local true
mode "0644"
variables(
ulimit_user: new_resource.username,