]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/systemd/templates/default/service.erb
Better CPU/IO scheduling for cron on tilecaches
[chef.git] / cookbooks / systemd / templates / default / service.erb
index 6d2b85e81fac20b5eb8eee12a8f1a18c0582e435..188404508470b65fb3c9f69e672a0c81a06a6796 100644 (file)
@@ -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 -%>
@@ -26,10 +45,15 @@ User=<%= @user %>
 <% if @group -%>
 Group=<%= @group %>
 <% end -%>
+<% if @working_directory -%>
+WorkingDirectory=<%= @working_directory %>
+<% end -%>
 <% if @exec_start_pre -%>
 ExecStartPre=<%= @exec_start_pre %>
 <% end -%>
+<% if @exec_start -%>
 ExecStart=<%= @exec_start %>
+<% end -%>
 <% if @exec_start_post -%>
 ExecStartPost=<%= @exec_start_post %>
 <% end -%>
@@ -39,6 +63,12 @@ ExecStop=<%= @exec_stop %>
 <% if @exec_reload -%>
 ExecReload=<%= @exec_reload %>
 <% end -%>
+<% if @runtime_directory -%>
+RuntimeDirectory=<%= @runtime_directory %>
+<% end -%>
+<% if @runtime_directory_mode -%>
+RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %>
+<% end -%>
 <% if @standard_input -%>
 StandardInput=<%= @standard_input %>
 <% end -%>
@@ -63,6 +93,18 @@ ProtectSystem=<%= @protect_system %>
 <% if @protect_home -%>
 ProtectHome=<%= @protect_home %>
 <% 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 -%>
 <% if @restart -%>
 Restart=<%= @restart %>
 <% end -%>
@@ -72,6 +114,17 @@ 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 -%>
+<% unless @dropin -%>
 
 [Install]
 WantedBy=multi-user.target
+<% end -%>