X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c37f6bcb0e397648dd6fd30794689aa939f978f6..836eb68cbcf384f9ebb0c3d48e3a5a47615039ab:/cookbooks/systemd/templates/default/service.erb diff --git a/cookbooks/systemd/templates/default/service.erb b/cookbooks/systemd/templates/default/service.erb index f7f851ae5..6d8a603cc 100644 --- a/cookbooks/systemd/templates/default/service.erb +++ b/cookbooks/systemd/templates/default/service.erb @@ -1,7 +1,9 @@ # DO NOT EDIT - This file is being maintained by Chef [Unit] +<% if @description -%> Description=<%= @description %> +<% end -%> <% if @after -%> After=<%= Array(@after).join(" ") %> <% end -%> @@ -10,10 +12,27 @@ Wants=<%= Array(@wants).join(" ") %> <% end -%> [Service] +<% if @type -%> Type=<%= @type %> +<% end -%> <% if @limit_nofile -%> LimitNOFILE=<%= @limit_nofile %> <% end -%> +<% if @limit_as -%> +LimitAS=<%= @limit_as %> +<% end -%> +<% if @limit_cpu -%> +LimitCPU=<%= @limit_cpu %> +<% end -%> +<% if @memory_low -%> +MemoryLow=<%= @memory_low %> +<% end -%> +<% if @memory_high -%> +MemoryHigh=<%= @memory_high %> +<% end -%> +<% if @memory_max -%> +MemoryMax=<%= @memory_max %> +<% end -%> <% @environment.each do |name,value| -%> Environment="<%= name %>=<%= value %>" <% end -%> @@ -30,16 +49,33 @@ Group=<%= @group %> WorkingDirectory=<%= @working_directory %> <% end -%> <% if @exec_start_pre -%> +<% if @dropin -%> +ExecStartPre= +<% end -%> ExecStartPre=<%= @exec_start_pre %> <% end -%> +<% if @exec_start -%> +<% if @dropin -%> +ExecStart= +<% end -%> ExecStart=<%= @exec_start %> +<% end -%> <% if @exec_start_post -%> +<% if @dropin -%> +ExecStartPost= +<% end -%> ExecStartPost=<%= @exec_start_post %> <% end -%> <% if @exec_stop -%> +<% if @dropin -%> +ExecStop= +<% end -%> ExecStop=<%= @exec_stop %> <% end -%> <% if @exec_reload -%> +<% if @dropin -%> +ExecReload= +<% end -%> ExecReload=<%= @exec_reload %> <% end -%> <% if @runtime_directory -%> @@ -72,9 +108,24 @@ ProtectSystem=<%= @protect_system %> <% if @protect_home -%> ProtectHome=<%= @protect_home %> <% end -%> +<% if @read_write_paths -%> +ReadWritePaths=<%= Array(@read_write_paths).join(" ") %> +<% end -%> +<% if @read_only_paths -%> +ReadOnlyPaths=<%= Array(@read_only_paths).join(" ") %> +<% end -%> +<% if @inaccessible_paths -%> +InaccessiblePaths=<%= Array(@inaccessible_paths).join(" ") %> +<% end -%> +<% if @restrict_address_families -%> +RestrictAddressFamilies=<%= Array(@restrict_address_families).join(" ") %> +<% end -%> <% if @no_new_privileges -%> NoNewPrivileges=<%= @no_new_privileges %> <% end -%> +<% if @tasks_max -%> +TasksMax=<%= @tasks_max %> +<% end -%> <% if @success_exit_status -%> SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %> <% end -%> @@ -87,6 +138,20 @@ TimeoutSec=<%= @timeout_sec %> <% if @pid_file -%> PIDFile=<%= @pid_file %> <% end -%> +<% if @nice -%> +Nice=<%= @nice %> +<% end -%> +<% if @io_scheduling_class -%> +IOSchedulingClass=<%= @io_scheduling_class %> +<% end -%> +<% if @io_scheduling_priority -%> +IOSchedulingPriority=<%= @io_scheduling_priority %> +<% end -%> +<% if @kill_mode -%> +KillMode=<%= @kill_mode %> +<% end -%> +<% unless @dropin -%> [Install] WantedBy=multi-user.target +<% end -%>