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