]> git.openstreetmap.org Git - chef.git/blob - cookbooks/systemd/templates/default/service.erb
29bd10e3380a4b3853bda20cacc01339bf222f31
[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 @exec_start_pre -%>
73 <% if @dropin -%>
74 ExecStartPre=
75 <% end -%>
76 <% Array(@exec_start_pre).each do |exec_start_pre| -%>
77 ExecStartPre=<%= exec_start_pre %>
78 <% end -%>
79 <% end -%>
80 <% if @exec_start -%>
81 <% if @dropin -%>
82 ExecStart=
83 <% end -%>
84 <% Array(@exec_start).each do |exec_start| -%>
85 ExecStart=<%= exec_start %>
86 <% end -%>
87 <% end -%>
88 <% if @exec_start_post -%>
89 <% if @dropin -%>
90 ExecStartPost=
91 <% end -%>
92 <% Array(@exec_start_post).each do |exec_start_post| -%>
93 ExecStartPost=<%= exec_start_post %>
94 <% end -%>
95 <% end -%>
96 <% if @exec_stop -%>
97 <% if @dropin -%>
98 ExecStop=
99 <% end -%>
100 <% Array(@exec_stop).each do |exec_stop| -%>
101 ExecStop=<%= exec_stop %>
102 <% end -%>
103 <% end -%>
104 <% if @exec_stop_post -%>
105 <% if @dropin -%>
106 ExecStopPost=
107 <% end -%>
108 <% Array(@exec_stop_post).each do |exec_stop_post| -%>
109 ExecStopPost=<%= exec_stop_post %>
110 <% end -%>
111 <% end -%>
112 <% if @exec_reload -%>
113 <% if @dropin -%>
114 ExecReload=
115 <% end -%>
116 ExecReload=<%= @exec_reload %>
117 <% end -%>
118 <% if @runtime_max_sec -%>
119 RuntimeMaxSec=<%= @runtime_max_sec %>
120 <% end -%>
121 <% if @runtime_directory -%>
122 RuntimeDirectory=<%= @runtime_directory %>
123 <% end -%>
124 <% if @runtime_directory_mode -%>
125 RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %>
126 <% end -%>
127 <% if @state_directory -%>
128 StateDirectory=<%= @state_directory %>
129 <% end -%>
130 <% if @state_directory_mode -%>
131 StateDirectoryMode=<%= sprintf("0%o", @state_directory_mode) %>
132 <% end -%>
133 <% if @cache_directory -%>
134 CacheDirectory=<%= @cache_directory %>
135 <% end -%>
136 <% if @cache_directory_mode -%>
137 CacheDirectoryMode=<%= sprintf("0%o", @cache_directory_mode) %>
138 <% end -%>
139 <% if @logs_directory -%>
140 LogsDirectory=<%= @logs_directory %>
141 <% end -%>
142 <% if @logs_directory_mode -%>
143 LogsDirectoryMode=<%= sprintf("0%o", @logs_directory_mode) %>
144 <% end -%>
145 <% if @configuration_directory -%>
146 ConfigurationDirectory=<%= @configuration_directory %>
147 <% end -%>
148 <% if @configuration_directory_mode -%>
149 ConfigurationDirectoryMode=<%= sprintf("0%o", @configuration_directory_mode) %>
150 <% end -%>
151 <% if @standard_input -%>
152 StandardInput=<%= @standard_input %>
153 <% end -%>
154 <% if @standard_output -%>
155 StandardOutput=<%= @standard_output %>
156 <% end -%>
157 <% if @standard_error -%>
158 StandardError=<%= @standard_error %>
159 <% end -%>
160 <% if @protect_proc && node[:lsb][:release].to_f >= 22.04  -%>
161 ProtectProc=<%= @protect_proc %>
162 <% end -%>
163 <% if @proc_subset && node[:lsb][:release].to_f >= 22.04 -%>
164 ProcSubset=<%= @proc_subset %>
165 <% end -%>
166 <% if @bind_paths -%>
167 BindPaths=<%= Array(@bind_paths).sort.uniq.join(" ") %>
168 <% end -%>
169 <% if @bind_read_only_paths -%>
170 BindReadOnlyPaths=<%= Array(@bind_read_only_paths).sort.uniq.join(" ") %>
171 <% end -%>
172 <% if @no_new_privileges -%>
173 NoNewPrivileges=<%= @no_new_privileges %>
174 <% end -%>
175 <% if @capability_bounding_set -%>
176 CapabilityBoundingSet=<%= Array(@capability_bounding_set).sort.uniq.join(" ") %>
177 <% end -%>
178 <% if @ambient_capabilities -%>
179 AmbientCapabilities=<%= Array(@ambient_capabilities).sort.uniq.join(" ") %>
180 <% end -%>
181 <% if @protect_system -%>
182 ProtectSystem=<%= @protect_system %>
183 <% end -%>
184 <% if @protect_home -%>
185 ProtectHome=<%= @protect_home %>
186 <% end -%>
187 <% if @read_write_paths -%>
188 ReadWritePaths=<%= Array(@read_write_paths).sort.uniq.join(" ") %>
189 <% end -%>
190 <% if @read_only_paths -%>
191 ReadOnlyPaths=<%= Array(@read_only_paths).sort.uniq.join(" ") %>
192 <% end -%>
193 <% if @inaccessible_paths -%>
194 InaccessiblePaths=<%= Array(@inaccessible_paths).sort.uniq.join(" ") %>
195 <% end -%>
196 <% if @private_tmp -%>
197 PrivateTmp=<%= @private_tmp %>
198 <% end -%>
199 <% if @private_devices -%>
200 PrivateDevices=<%= @private_devices %>
201 <% end -%>
202 <% if @private_network -%>
203 PrivateNetwork=<%= @private_network %>
204 <% end -%>
205 <% if @private_ipc && node[:lsb][:release].to_f >= 22.04 -%>
206 PrivateIPC=<%= @private_ipc %>
207 <% end -%>
208 <% if @private_users -%>
209 PrivateUsers=<%= @private_users %>
210 <% end -%>
211 <% if @protect_hostname -%>
212 ProtectHostname=<%= @protect_hostname %>
213 <% end -%>
214 <% if @protect_clock -%>
215 ProtectClock=<%= @protect_clock %>
216 <% end -%>
217 <% if @protect_kernel_tunables -%>
218 ProtectKernelTunables=<%= @protect_kernel_tunables %>
219 <% end -%>
220 <% if @protect_kernel_modules -%>
221 ProtectKernelModules=<%= @protect_kernel_modules %>
222 <% end -%>
223 <% if @protect_kernel_logs -%>
224 ProtectKernelLogs=<%= @protect_kernel_logs %>
225 <% end -%>
226 <% if @protect_control_groups -%>
227 ProtectControlGroups=<%= @protect_control_groups %>
228 <% end -%>
229 <% if @restrict_address_families -%>
230 RestrictAddressFamilies=<%= Array(@restrict_address_families).sort.uniq.join(" ") %>
231 <% end -%>
232 <% if @restrict_namespaces -%>
233 RestrictNamespaces=<%= Array(@restrict_namespaces).sort.uniq.join(" ") %>
234 <% end -%>
235 <% if @lock_personality -%>
236 LockPersonality=<%= @lock_personality %>
237 <% end -%>
238 <% if @memory_deny_write_execute -%>
239 MemoryDenyWriteExecute=<%= @memory_deny_write_execute %>
240 <% end -%>
241 <% if @restrict_realtime -%>
242 RestrictRealtime=<%= @restrict_realtime %>
243 <% end -%>
244 <% if @restrict_suid_sgid -%>
245 RestrictSUIDSGID=<%= @restrict_suid_sgid %>
246 <% end -%>
247 <% if @remove_ipc -%>
248 RemoveIPC=<%= @remove_ipc %>
249 <% end -%>
250 <% if @system_call_filter -%>
251 SystemCallFilter=<%= Array(@system_call_filter).join(" ") %>
252 <% end -%>
253 <% if @system_call_architectures -%>
254 SystemCallArchitectures=<%= Array(@system_call_architectures).sort.uniq.join(" ") %>
255 <% end -%>
256 <% if @tasks_max -%>
257 TasksMax=<%= @tasks_max %>
258 <% end -%>
259 <% if @success_exit_status -%>
260 SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %>
261 <% end -%>
262 <% if @restart -%>
263 Restart=<%= @restart %>
264 <% end -%>
265 <% if @restart_sec -%>
266 RestartSec=<%= @restart_sec %>
267 <% end -%>
268 <% if @timeout_start_sec -%>
269 TimeoutStartSec=<%= @timeout_start_sec %>
270 <% end -%>
271 <% if @timeout_stop_sec -%>
272 TimeoutStopSec=<%= @timeout_stop_sec %>
273 <% end -%>
274 <% if @timeout_abort_sec -%>
275 TimeoutAbortSec=<%= @timeout_abort_sec %>
276 <% end -%>
277 <% if @timeout_sec -%>
278 TimeoutSec=<%= @timeout_sec %>
279 <% end -%>
280 <% if @pid_file -%>
281 PIDFile=<%= @pid_file %>
282 <% end -%>
283 <% if @nice -%>
284 Nice=<%= @nice %>
285 <% end -%>
286 <% if @io_scheduling_class -%>
287 IOSchedulingClass=<%= @io_scheduling_class %>
288 <% end -%>
289 <% if @io_scheduling_priority -%>
290 IOSchedulingPriority=<%= @io_scheduling_priority %>
291 <% end -%>
292 <% if @kill_mode -%>
293 KillMode=<%= @kill_mode %>
294 <% end -%>
295 <% unless @dropin -%>
296
297 [Install]
298 WantedBy=multi-user.target
299 <% end -%>