From 15219fdfa4b2d38fd413e91e5aab3d409449f26a Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 3 Dec 2019 22:23:48 +0000 Subject: [PATCH 1/1] systemd: add killmode support --- cookbooks/systemd/resources/service.rb | 2 ++ cookbooks/systemd/templates/default/service.erb | 3 +++ 2 files changed, 5 insertions(+) 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] -- 2.43.2