]> git.openstreetmap.org Git - chef.git/blob - cookbooks/systemd/templates/default/service.erb
a106b001b0b6a6bb8fcf7723b0bc253a7468b345
[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 @limit_nofile -%>
34 LimitNOFILE=<%= @limit_nofile %>
35 <% end -%>
36 <% if @limit_as -%>
37 LimitAS=<%= @limit_as %>
38 <% end -%>
39 <% if @limit_cpu -%>
40 LimitCPU=<%= @limit_cpu %>
41 <% end -%>
42 <% if @memory_low -%>
43 MemoryLow=<%= @memory_low %>
44 <% end -%>
45 <% if @memory_high -%>
46 MemoryHigh=<%= @memory_high %>
47 <% end -%>
48 <% if @memory_max -%>
49 MemoryMax=<%= @memory_max %>
50 <% end -%>
51 <% @environment.each do |name,value| -%>
52 Environment="<%= name %>=<%= value %>"
53 <% end -%>
54 <% if @environment_file -%>
55 EnvironmentFile=<%= @environment_file %>
56 <% end -%>
57 <% if @user -%>
58 User=<%= @user %>
59 <% end -%>
60 <% if @group -%>
61 Group=<%= @group %>
62 <% end -%>
63 <% if @dynamic_user -%>
64 DynamicUser=<%= @dynamic_user %>
65 <% end -%>
66 <% if @working_directory -%>
67 WorkingDirectory=<%= @working_directory %>
68 <% end -%>
69 <% if @exec_start_pre -%>
70 <% if @dropin -%>
71 ExecStartPre=
72 <% end -%>
73 <% Array(@exec_start_pre).each do |exec_start_pre| -%>
74 ExecStartPre=<%= exec_start_pre %>
75 <% end -%>
76 <% end -%>
77 <% if @exec_start -%>
78 <% if @dropin -%>
79 ExecStart=
80 <% end -%>
81 <% Array(@exec_start).each do |exec_start| -%>
82 ExecStart=<%= exec_start %>
83 <% end -%>
84 <% end -%>
85 <% if @exec_start_post -%>
86 <% if @dropin -%>
87 ExecStartPost=
88 <% end -%>
89 <% Array(@exec_start_post).each do |exec_start_post| -%>
90 ExecStartPost=<%= exec_start_post %>
91 <% end -%>
92 <% end -%>
93 <% if @exec_stop -%>
94 <% if @dropin -%>
95 ExecStop=
96 <% end -%>
97 <% Array(@exec_stop).each do |exec_stop| -%>
98 ExecStop=<%= exec_stop %>
99 <% end -%>
100 <% end -%>
101 <% if @exec_reload -%>
102 <% if @dropin -%>
103 ExecReload=
104 <% end -%>
105 ExecReload=<%= @exec_reload %>
106 <% end -%>
107 <% if @runtime_directory -%>
108 RuntimeDirectory=<%= @runtime_directory %>
109 <% end -%>
110 <% if @runtime_directory_mode -%>
111 RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %>
112 <% end -%>
113 <% if @runtime_max_sec -%>
114 RuntimeMaxSec=<%= @runtime_max_sec %>
115 <% end -%>
116 <% if @standard_input -%>
117 StandardInput=<%= @standard_input %>
118 <% end -%>
119 <% if @standard_output -%>
120 StandardOutput=<%= @standard_output %>
121 <% end -%>
122 <% if @standard_error -%>
123 StandardError=<%= @standard_error %>
124 <% end -%>
125 <% if @protect_proc && node[:lsb][:release].to_f >= 22.04  -%>
126 ProtectProc=<%= @protect_proc %>
127 <% end -%>
128 <% if @proc_subset && node[:lsb][:release].to_f >= 22.04 -%>
129 ProcSubset=<%= @proc_subset %>
130 <% end -%>
131 <% if @no_new_privileges -%>
132 NoNewPrivileges=<%= @no_new_privileges %>
133 <% end -%>
134 <% if @capability_bounding_set -%>
135 CapabilityBoundingSet=<%= Array(@capability_bounding_set).sort.uniq.join(" ") %>
136 <% end -%>
137 <% if @protect_system -%>
138 ProtectSystem=<%= @protect_system %>
139 <% end -%>
140 <% if @protect_home -%>
141 ProtectHome=<%= @protect_home %>
142 <% end -%>
143 <% if @read_write_paths -%>
144 ReadWritePaths=<%= Array(@read_write_paths).sort.uniq.join(" ") %>
145 <% end -%>
146 <% if @read_only_paths -%>
147 ReadOnlyPaths=<%= Array(@read_only_paths).sort.uniq.join(" ") %>
148 <% end -%>
149 <% if @inaccessible_paths -%>
150 InaccessiblePaths=<%= Array(@inaccessible_paths).sort.uniq.join(" ") %>
151 <% end -%>
152 <% if @private_tmp -%>
153 PrivateTmp=<%= @private_tmp %>
154 <% end -%>
155 <% if @private_devices -%>
156 PrivateDevices=<%= @private_devices %>
157 <% end -%>
158 <% if @private_network -%>
159 PrivateNetwork=<%= @private_network %>
160 <% end -%>
161 <% if @private_ipc && node[:lsb][:release].to_f >= 22.04 -%>
162 PrivateIPC=<%= @private_ipc %>
163 <% end -%>
164 <% if @private_users -%>
165 PrivateUsers=<%= @private_users %>
166 <% end -%>
167 <% if @protect_hostname -%>
168 ProtectHostname=<%= @protect_hostname %>
169 <% end -%>
170 <% if @protect_clock -%>
171 ProtectClock=<%= @protect_clock %>
172 <% end -%>
173 <% if @protect_kernel_tunables -%>
174 ProtectKernelTunables=<%= @protect_kernel_tunables %>
175 <% end -%>
176 <% if @protect_kernel_modules -%>
177 ProtectKernelModules=<%= @protect_kernel_modules %>
178 <% end -%>
179 <% if @protect_kernel_logs -%>
180 ProtectKernelLogs=<%= @protect_kernel_logs %>
181 <% end -%>
182 <% if @protect_control_groups -%>
183 ProtectControlGroups=<%= @protect_control_groups %>
184 <% end -%>
185 <% if @restrict_address_families -%>
186 RestrictAddressFamilies=<%= Array(@restrict_address_families).sort.uniq.join(" ") %>
187 <% end -%>
188 <% if @restrict_namespaces -%>
189 RestrictNamespaces=<%= Array(@restrict_namespaces).sort.uniq.join(" ") %>
190 <% end -%>
191 <% if @lock_personality -%>
192 LockPersonality=<%= @lock_personality %>
193 <% end -%>
194 <% if @memory_deny_write_execute -%>
195 MemoryDenyWriteExecute=<%= @memory_deny_write_execute %>
196 <% end -%>
197 <% if @restrict_realtime -%>
198 RestrictRealtime=<%= @restrict_realtime %>
199 <% end -%>
200 <% if @restrict_suid_sgid -%>
201 RestrictSUIDSGID=<%= @restrict_suid_sgid %>
202 <% end -%>
203 <% if @remove_ipc -%>
204 RemoveIPC=<%= @remove_ipc %>
205 <% end -%>
206 <% if @system_call_filter -%>
207 SystemCallFilter=<%= Array(@system_call_filter).join(" ") %>
208 <% end -%>
209 <% if @system_call_architectures -%>
210 SystemCallArchitectures=<%= Array(@system_call_architectures).sort.uniq.join(" ") %>
211 <% end -%>
212 <% if @tasks_max -%>
213 TasksMax=<%= @tasks_max %>
214 <% end -%>
215 <% if @success_exit_status -%>
216 SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %>
217 <% end -%>
218 <% if @restart -%>
219 Restart=<%= @restart %>
220 <% end -%>
221 <% if @timeout_start_sec -%>
222 TimeoutStartSec=<%= @timeout_start_sec %>
223 <% end -%>
224 <% if @timeout_stop_sec -%>
225 TimeoutStopSec=<%= @timeout_stop_sec %>
226 <% end -%>
227 <% if @timeout_abort_sec -%>
228 TimeoutAbortSec=<%= @timeout_abort_sec %>
229 <% end -%>
230 <% if @timeout_sec -%>
231 TimeoutSec=<%= @timeout_sec %>
232 <% end -%>
233 <% if @pid_file -%>
234 PIDFile=<%= @pid_file %>
235 <% end -%>
236 <% if @nice -%>
237 Nice=<%= @nice %>
238 <% end -%>
239 <% if @io_scheduling_class -%>
240 IOSchedulingClass=<%= @io_scheduling_class %>
241 <% end -%>
242 <% if @io_scheduling_priority -%>
243 IOSchedulingPriority=<%= @io_scheduling_priority %>
244 <% end -%>
245 <% if @kill_mode -%>
246 KillMode=<%= @kill_mode %>
247 <% end -%>
248 <% unless @dropin -%>
249
250 [Install]
251 WantedBy=multi-user.target
252 <% end -%>