]> git.openstreetmap.org Git - chef.git/commitdiff
systemd: add StopWhenUnneeded service support
authorGrant Slater <github@firefishy.com>
Tue, 3 Dec 2024 13:02:25 +0000 (13:02 +0000)
committerGrant Slater <github@firefishy.com>
Tue, 3 Dec 2024 13:03:49 +0000 (13:03 +0000)
cookbooks/systemd/resources/service.rb
cookbooks/systemd/templates/default/service.erb

index 3a9f0b893e2d19337b755dc29dac4d821039d898..11ca0e28c9246384a6e8d8b674fbc51a59e6ccb2 100644 (file)
@@ -106,6 +106,7 @@ property :memory_deny_write_execute, [true, false]
 property :restrict_realtime, [true, false]
 property :restrict_suid_sgid, [true, false]
 property :remove_ipc, [true, false]
+property :stop_when_unneeded, [true, false]
 property :system_call_filter, [String, Array]
 property :system_call_architectures, [String, Array]
 property :tasks_max, Integer
index 197d8bddf80dd6972be5d9eb550f69f6d6d8ff79..92d70de85b3dabe7bf7de934dfcb48eb906884a1 100644 (file)
@@ -25,6 +25,9 @@ Requires=<%= Array(@requires).join(" ") %>
 <% if @joins_namespace_of -%>
 JoinsNamespaceOf=<%= Array(@joins_namespace_of).join(" ") %>
 <% end -%>
+<% if @stop_when_unneeded -%>
+StopWhenUnneeded=<%= @stop_when_unneeded %>
+<% end -%>
 
 [Service]
 <% if @type -%>