]> git.openstreetmap.org Git - chef.git/blob - cookbooks/systemd/templates/default/service.erb
Merge remote-tracking branch 'github/pull/668'
[chef.git] / cookbooks / systemd / templates / default / service.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 [Unit]
4 <% if @description -%>
5 Description=<%= @description %>
6 <% end -%>
7 <% if @condition_path_exists -%>
8 ConditionPathExists=<%= Array(@condition_path_exists).join(" ") %>
9 <% end -%>
10 <% if @condition_path_exists_glob -%>
11 ConditionPathExistsGlob=<%= Array(@condition_path_exists_glob).join(" ") %>
12 <% end -%>
13 <% if @after -%>
14 After=<%= Array(@after).join(" ") %>
15 <% end -%>
16 <% if @conflicts -%>
17 Conflicts=<%= Array(@conflicts).join(" ") %>
18 <% end -%>
19 <% if @wants -%>
20 Wants=<%= Array(@wants).join(" ") %>
21 <% end -%>
22 <% if @requires -%>
23 Requires=<%= Array(@requires).join(" ") %>
24 <% end -%>
25 <% if @joins_namespace_of -%>
26 JoinsNamespaceOf=<%= Array(@joins_namespace_of).join(" ") %>
27 <% end -%>
28
29 [Service]
30 <% if @type -%>
31 Type=<%= @type %>
32 <% end -%>
33 <% if @notify_access -%>
34 NotifyAccess=<%= @notify_access %>
35 <% end -%>
36 <% if @limit_nofile -%>
37 LimitNOFILE=<%= @limit_nofile %>
38 <% end -%>
39 <% if @limit_as -%>
40 LimitAS=<%= @limit_as %>
41 <% end -%>
42 <% if @limit_cpu -%>
43 LimitCPU=<%= @limit_cpu %>
44 <% end -%>
45 <% if @memory_low -%>
46 MemoryLow=<%= @memory_low %>
47 <% end -%>
48 <% if @memory_high -%>
49 MemoryHigh=<%= @memory_high %>
50 <% end -%>
51 <% if @memory_max -%>
52 MemoryMax=<%= @memory_max %>
53 <% end -%>
54 <% @environment.each do |name,value| -%>
55 Environment="<%= name %>=<%= value %>"
56 <% end -%>
57 <% if @environment_file -%>
58 EnvironmentFile=<%= @environment_file %>
59 <% end -%>
60 <% if @user -%>
61 User=<%= @user %>
62 <% end -%>
63 <% if @group -%>
64 Group=<%= @group %>
65 <% end -%>
66 <% if @dynamic_user -%>
67 DynamicUser=<%= @dynamic_user %>
68 <% end -%>
69 <% if @working_directory -%>
70 WorkingDirectory=<%= @working_directory %>
71 <% end -%>
72 <% if @umask -%>
73 UMask=<%= @umask %>
74 <% end -%>
75 <% if @exec_start_pre -%>
76 <% if @dropin -%>
77 ExecStartPre=
78 <% end -%>
79 <% Array(@exec_start_pre).each do |exec_start_pre| -%>
80 ExecStartPre=<%= exec_start_pre %>
81 <% end -%>
82 <% end -%>
83 <% if @exec_start -%>
84 <% if @dropin -%>
85 ExecStart=
86 <% end -%>
87 <% Array(@exec_start).each do |exec_start| -%>
88 ExecStart=<%= exec_start %>
89 <% end -%>
90 <% end -%>
91 <% if @exec_start_post -%>
92 <% if @dropin -%>
93 ExecStartPost=
94 <% end -%>
95 <% Array(@exec_start_post).each do |exec_start_post| -%>
96 ExecStartPost=<%= exec_start_post %>
97 <% end -%>
98 <% end -%>
99 <% if @exec_stop -%>
100 <% if @dropin -%>
101 ExecStop=
102 <% end -%>
103 <% Array(@exec_stop).each do |exec_stop| -%>
104 ExecStop=<%= exec_stop %>
105 <% end -%>
106 <% end -%>
107 <% if @exec_stop_post -%>
108 <% if @dropin -%>
109 ExecStopPost=
110 <% end -%>
111 <% Array(@exec_stop_post).each do |exec_stop_post| -%>
112 ExecStopPost=<%= exec_stop_post %>
113 <% end -%>
114 <% end -%>
115 <% if @exec_reload -%>
116 <% if @dropin -%>
117 ExecReload=
118 <% end -%>
119 ExecReload=<%= @exec_reload %>
120 <% end -%>
121 <% if @runtime_max_sec -%>
122 RuntimeMaxSec=<%= @runtime_max_sec %>
123 <% end -%>
124 <% if @runtime_directory -%>
125 RuntimeDirectory=<%= @runtime_directory %>
126 <% end -%>
127 <% if @runtime_directory_mode -%>
128 RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %>
129 <% end -%>
130 <% if @runtime_directory_preserve -%>
131 RuntimeDirectoryPreserve=<%= @runtime_directory_preserve %>
132 <% end -%>
133 <% if @state_directory -%>
134 StateDirectory=<%= @state_directory %>
135 <% end -%>
136 <% if @state_directory_mode -%>
137 StateDirectoryMode=<%= sprintf("0%o", @state_directory_mode) %>
138 <% end -%>
139 <% if @cache_directory -%>
140 CacheDirectory=<%= @cache_directory %>
141 <% end -%>
142 <% if @cache_directory_mode -%>
143 CacheDirectoryMode=<%= sprintf("0%o", @cache_directory_mode) %>
144 <% end -%>
145 <% if @logs_directory -%>
146 LogsDirectory=<%= @logs_directory %>
147 <% end -%>
148 <% if @logs_directory_mode -%>
149 LogsDirectoryMode=<%= sprintf("0%o", @logs_directory_mode) %>
150 <% end -%>
151 <% if @configuration_directory -%>
152 ConfigurationDirectory=<%= @configuration_directory %>
153 <% end -%>
154 <% if @configuration_directory_mode -%>
155 ConfigurationDirectoryMode=<%= sprintf("0%o", @configuration_directory_mode) %>
156 <% end -%>
157 <% if @standard_input -%>
158 StandardInput=<%= @standard_input %>
159 <% end -%>
160 <% if @standard_output -%>
161 StandardOutput=<%= @standard_output %>
162 <% end -%>
163 <% if @standard_error -%>
164 StandardError=<%= @standard_error %>
165 <% end -%>
166 <% if @protect_proc && node[:lsb][:release].to_f >= 22.04  -%>
167 ProtectProc=<%= @protect_proc %>
168 <% end -%>
169 <% if @proc_subset && node[:lsb][:release].to_f >= 22.04 -%>
170 ProcSubset=<%= @proc_subset %>
171 <% end -%>
172 <% if @bind_paths -%>
173 BindPaths=<%= Array(@bind_paths).sort.uniq.join(" ") %>
174 <% end -%>
175 <% if @bind_read_only_paths -%>
176 BindReadOnlyPaths=<%= Array(@bind_read_only_paths).sort.uniq.join(" ") %>
177 <% end -%>
178 <% if @no_new_privileges -%>
179 NoNewPrivileges=<%= @no_new_privileges %>
180 <% end -%>
181 <% if @capability_bounding_set -%>
182 CapabilityBoundingSet=<%= Array(@capability_bounding_set).sort.uniq.join(" ") %>
183 <% end -%>
184 <% if @ambient_capabilities -%>
185 AmbientCapabilities=<%= Array(@ambient_capabilities).sort.uniq.join(" ") %>
186 <% end -%>
187 <% if @protect_system -%>
188 ProtectSystem=<%= @protect_system %>
189 <% end -%>
190 <% if @protect_home -%>
191 ProtectHome=<%= @protect_home %>
192 <% end -%>
193 <% if @read_write_paths -%>
194 ReadWritePaths=<%= Array(@read_write_paths).sort.uniq.join(" ") %>
195 <% end -%>
196 <% if @read_only_paths -%>
197 ReadOnlyPaths=<%= Array(@read_only_paths).sort.uniq.join(" ") %>
198 <% end -%>
199 <% if @inaccessible_paths -%>
200 InaccessiblePaths=<%= Array(@inaccessible_paths).sort.uniq.join(" ") %>
201 <% end -%>
202 <% if @private_tmp -%>
203 PrivateTmp=<%= @private_tmp %>
204 <% end -%>
205 <% if @private_devices -%>
206 PrivateDevices=<%= @private_devices %>
207 <% end -%>
208 <% if @private_network -%>
209 PrivateNetwork=<%= @private_network %>
210 <% end -%>
211 <% if @private_ipc && node[:lsb][:release].to_f >= 22.04 -%>
212 PrivateIPC=<%= @private_ipc %>
213 <% end -%>
214 <% if @private_users -%>
215 PrivateUsers=<%= @private_users %>
216 <% end -%>
217 <% if @protect_hostname -%>
218 ProtectHostname=<%= @protect_hostname %>
219 <% end -%>
220 <% if @protect_clock -%>
221 ProtectClock=<%= @protect_clock %>
222 <% end -%>
223 <% if @protect_kernel_tunables -%>
224 ProtectKernelTunables=<%= @protect_kernel_tunables %>
225 <% end -%>
226 <% if @protect_kernel_modules -%>
227 ProtectKernelModules=<%= @protect_kernel_modules %>
228 <% end -%>
229 <% if @protect_kernel_logs -%>
230 ProtectKernelLogs=<%= @protect_kernel_logs %>
231 <% end -%>
232 <% if @protect_control_groups -%>
233 ProtectControlGroups=<%= @protect_control_groups %>
234 <% end -%>
235 <% if @restrict_address_families -%>
236 RestrictAddressFamilies=<%= Array(@restrict_address_families).sort.uniq.join(" ") %>
237 <% end -%>
238 <% if @restrict_namespaces -%>
239 RestrictNamespaces=<%= Array(@restrict_namespaces).sort.uniq.join(" ") %>
240 <% end -%>
241 <% if @lock_personality -%>
242 LockPersonality=<%= @lock_personality %>
243 <% end -%>
244 <% if @memory_deny_write_execute -%>
245 MemoryDenyWriteExecute=<%= @memory_deny_write_execute %>
246 <% end -%>
247 <% if @restrict_realtime -%>
248 RestrictRealtime=<%= @restrict_realtime %>
249 <% end -%>
250 <% if @restrict_suid_sgid -%>
251 RestrictSUIDSGID=<%= @restrict_suid_sgid %>
252 <% end -%>
253 <% if @remove_ipc -%>
254 RemoveIPC=<%= @remove_ipc %>
255 <% end -%>
256 <% if @system_call_filter -%>
257 SystemCallFilter=<%= Array(@system_call_filter).join(" ") %>
258 <% end -%>
259 <% if @system_call_architectures -%>
260 SystemCallArchitectures=<%= Array(@system_call_architectures).sort.uniq.join(" ") %>
261 <% end -%>
262 <% if @tasks_max -%>
263 TasksMax=<%= @tasks_max %>
264 <% end -%>
265 <% if @success_exit_status -%>
266 SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %>
267 <% end -%>
268 <% if @restart -%>
269 Restart=<%= @restart %>
270 <% end -%>
271 <% if @restart_sec -%>
272 RestartSec=<%= @restart_sec %>
273 <% end -%>
274 <% if @timeout_start_sec -%>
275 TimeoutStartSec=<%= @timeout_start_sec %>
276 <% end -%>
277 <% if @timeout_stop_sec -%>
278 TimeoutStopSec=<%= @timeout_stop_sec %>
279 <% end -%>
280 <% if @timeout_abort_sec -%>
281 TimeoutAbortSec=<%= @timeout_abort_sec %>
282 <% end -%>
283 <% if @timeout_sec -%>
284 TimeoutSec=<%= @timeout_sec %>
285 <% end -%>
286 <% if @pid_file -%>
287 PIDFile=<%= @pid_file %>
288 <% end -%>
289 <% if @nice -%>
290 Nice=<%= @nice %>
291 <% end -%>
292 <% if @io_scheduling_class -%>
293 IOSchedulingClass=<%= @io_scheduling_class %>
294 <% end -%>
295 <% if @io_scheduling_priority -%>
296 IOSchedulingPriority=<%= @io_scheduling_priority %>
297 <% end -%>
298 <% if @kill_mode -%>
299 KillMode=<%= @kill_mode %>
300 <% end -%>
301 <% unless @dropin -%>
302
303 [Install]
304 WantedBy=multi-user.target
305 <% end -%>