From: Grant Slater Date: Tue, 3 Dec 2019 22:23:48 +0000 (+0000) Subject: systemd: add killmode support X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/15219fdfa4b2d38fd413e91e5aab3d409449f26a?hp=de48d16a2549f1baa8c64eb0b99290b923160400 systemd: add killmode support --- diff --git a/cookbooks/systemd/resources/service.rb b/cookbooks/systemd/resources/service.rb index 4758f7af5..dfb6864c5 100644 --- a/cookbooks/systemd/resources/service.rb +++ b/cookbooks/systemd/resources/service.rb @@ -65,6 +65,8 @@ property :pid_file, String property :nice, Integer property :io_scheduling_class, [Integer, String] property :io_scheduling_priority, Integer +property :kill_mode, String, + :is => %w[control-group process mixed none] action :create do service_variables = new_resource.to_hash diff --git a/cookbooks/systemd/templates/default/service.erb b/cookbooks/systemd/templates/default/service.erb index 188404508..0d4abbcef 100644 --- a/cookbooks/systemd/templates/default/service.erb +++ b/cookbooks/systemd/templates/default/service.erb @@ -123,6 +123,9 @@ IOSchedulingClass=<%= @io_scheduling_class %> <% if @io_scheduling_priority -%> IOSchedulingPriority=<%= @io_scheduling_priority %> <% end -%> +<% if @kill_mode -%> +KillMode=<%= @kill_mode %> +<% end -%> <% unless @dropin -%> [Install]