From 1bc290ecce828f4a28d096c383815d2aa9199253 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 6 Oct 2021 00:47:53 +0100 Subject: [PATCH] Add systemd service RuntimeMaxSec --- cookbooks/systemd/resources/service.rb | 1 + cookbooks/systemd/templates/default/service.erb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cookbooks/systemd/resources/service.rb b/cookbooks/systemd/resources/service.rb index abfacb650..4b53051d3 100644 --- a/cookbooks/systemd/resources/service.rb +++ b/cookbooks/systemd/resources/service.rb @@ -48,6 +48,7 @@ property :exec_stop, String property :exec_reload, String property :runtime_directory, String property :runtime_directory_mode, Integer +property :runtime_max_sec, Integer property :standard_input, String, :is => %w[null tty tty-force tty-fail socket] property :standard_output, String, diff --git a/cookbooks/systemd/templates/default/service.erb b/cookbooks/systemd/templates/default/service.erb index eff7b8308..7786ab609 100644 --- a/cookbooks/systemd/templates/default/service.erb +++ b/cookbooks/systemd/templates/default/service.erb @@ -93,6 +93,9 @@ RuntimeDirectory=<%= @runtime_directory %> <% if @runtime_directory_mode -%> RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %> <% end -%> +<% if @runtime_max_sec -%> +RuntimeMaxSec=<%= @runtime_max_sec %> +<% end -%> <% if @standard_input -%> StandardInput=<%= @standard_input %> <% end -%> -- 2.39.5