From: Grant Slater Date: Fri, 21 Dec 2018 12:52:49 +0000 (+0000) Subject: systemd: Add LimitCPU support X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/09bf3029df3d69817a84fae6cbbddbac696376aa systemd: Add LimitCPU support --- diff --git a/cookbooks/systemd/resources/service.rb b/cookbooks/systemd/resources/service.rb index f0419b911..c2d125b18 100644 --- a/cookbooks/systemd/resources/service.rb +++ b/cookbooks/systemd/resources/service.rb @@ -28,6 +28,7 @@ property :type, String, :is => %w[simple forking oneshot dbus notify idle] property :limit_nofile, Integer property :limit_as, [Integer, String] +property :limit_cpu, [Integer, String] property :memory_low, [Integer, String] property :memory_high, [Integer, String] property :memory_max, [Integer, String] diff --git a/cookbooks/systemd/templates/default/service.erb b/cookbooks/systemd/templates/default/service.erb index 4cac416f7..151b01790 100644 --- a/cookbooks/systemd/templates/default/service.erb +++ b/cookbooks/systemd/templates/default/service.erb @@ -17,6 +17,9 @@ LimitNOFILE=<%= @limit_nofile %> <% if @limit_as -%> LimitAS=<%= @limit_as %> <% end -%> +<% if @limit_cpu -%> +LimitCPU=<%= @limit_cpu %> +<% end -%> <% if @memory_low -%> MemoryLow=<%= @memory_low %> <% end -%>