From: Tom Hughes Date: Fri, 8 Jul 2022 07:49:13 +0000 (+0100) Subject: Add support for additional systemd service timeout options X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/888bba417b1e8bbfa4e85b1681eaf483c3e2aabe?ds=inline Add support for additional systemd service timeout options --- diff --git a/cookbooks/systemd/resources/service.rb b/cookbooks/systemd/resources/service.rb index 4b53051d3..aa575189d 100644 --- a/cookbooks/systemd/resources/service.rb +++ b/cookbooks/systemd/resources/service.rb @@ -69,6 +69,9 @@ property :inaccessible_paths, [String, Array] property :restrict_address_families, [String, Array] property :no_new_privileges, [true, false] property :tasks_max, Integer +property :timeout_start_sec, Integer +property :timeout_stop_sec, Integer +property :timeout_abort_sec, Integer property :timeout_sec, Integer property :pid_file, String property :nice, Integer diff --git a/cookbooks/systemd/templates/default/service.erb b/cookbooks/systemd/templates/default/service.erb index 7786ab609..4fba56c0f 100644 --- a/cookbooks/systemd/templates/default/service.erb +++ b/cookbooks/systemd/templates/default/service.erb @@ -144,6 +144,15 @@ SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %> <% if @restart -%> Restart=<%= @restart %> <% end -%> +<% if @timeout_start_sec -%> +TimeoutStartSec=<%= @timeout_start_sec %> +<% end -%> +<% if @timeout_stop_sec -%> +TimeoutStopSec=<%= @timeout_stop_sec %> +<% end -%> +<% if @timeout_abort_sec -%> +TimeoutAbortSec=<%= @timeout_abort_sec %> +<% end -%> <% if @timeout_sec -%> TimeoutSec=<%= @timeout_sec %> <% end -%>