]> git.openstreetmap.org Git - chef.git/blob - cookbooks/systemd/templates/default/service.erb
systemd: add dropin support for exec actions
[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 @after -%>
8 After=<%= Array(@after).join(" ") %>
9 <% end -%>
10 <% if @wants -%>
11 Wants=<%= Array(@wants).join(" ") %>
12 <% end -%>
13
14 [Service]
15 <% if @type -%>
16 Type=<%= @type %>
17 <% end -%>
18 <% if @limit_nofile -%>
19 LimitNOFILE=<%= @limit_nofile %>
20 <% end -%>
21 <% if @limit_as -%>
22 LimitAS=<%= @limit_as %>
23 <% end -%>
24 <% if @limit_cpu -%>
25 LimitCPU=<%= @limit_cpu %>
26 <% end -%>
27 <% if @memory_low -%>
28 MemoryLow=<%= @memory_low %>
29 <% end -%>
30 <% if @memory_high -%>
31 MemoryHigh=<%= @memory_high %>
32 <% end -%>
33 <% if @memory_max -%>
34 MemoryMax=<%= @memory_max %>
35 <% end -%>
36 <% @environment.each do |name,value| -%>
37 Environment="<%= name %>=<%= value %>"
38 <% end -%>
39 <% if @environment_file -%>
40 EnvironmentFile=<%= @environment_file %>
41 <% end -%>
42 <% if @user -%>
43 User=<%= @user %>
44 <% end -%>
45 <% if @group -%>
46 Group=<%= @group %>
47 <% end -%>
48 <% if @working_directory -%>
49 WorkingDirectory=<%= @working_directory %>
50 <% end -%>
51 <% if @exec_start_pre -%>
52 <% if @dropin -%>
53 ExecStartPre=
54 <% end -%>
55 ExecStartPre=<%= @exec_start_pre %>
56 <% end -%>
57 <% if @exec_start -%>
58 <% if @dropin -%>
59 ExecStart=
60 <% end -%>
61 ExecStart=<%= @exec_start %>
62 <% end -%>
63 <% if @exec_start_post -%>
64 <% if @dropin -%>
65 ExecStartPost=
66 <% end -%>
67 ExecStartPost=<%= @exec_start_post %>
68 <% end -%>
69 <% if @exec_stop -%>
70 <% if @dropin -%>
71 ExecStop=
72 <% end -%>
73 ExecStop=<%= @exec_stop %>
74 <% end -%>
75 <% if @exec_reload -%>
76 <% if @dropin -%>
77 ExecReload=
78 <% end -%>
79 ExecReload=<%= @exec_reload %>
80 <% end -%>
81 <% if @runtime_directory -%>
82 RuntimeDirectory=<%= @runtime_directory %>
83 <% end -%>
84 <% if @runtime_directory_mode -%>
85 RuntimeDirectoryMode=<%= sprintf("0%o", @runtime_directory_mode) %>
86 <% end -%>
87 <% if @standard_input -%>
88 StandardInput=<%= @standard_input %>
89 <% end -%>
90 <% if @standard_output -%>
91 StandardOutput=<%= @standard_output %>
92 <% end -%>
93 <% if @standard_error -%>
94 StandardError=<%= @standard_error %>
95 <% end -%>
96 <% if @private_tmp -%>
97 PrivateTmp=<%= @private_tmp %>
98 <% end -%>
99 <% if @private_devices -%>
100 PrivateDevices=<%= @private_devices %>
101 <% end -%>
102 <% if @private_network -%>
103 PrivateNetwork=<%= @private_network %>
104 <% end -%>
105 <% if @protect_system -%>
106 ProtectSystem=<%= @protect_system %>
107 <% end -%>
108 <% if @protect_home -%>
109 ProtectHome=<%= @protect_home %>
110 <% end -%>
111 <% if @restrict_address_families -%>
112 RestrictAddressFamilies=<%= Array(@restrict_address_families).join(" ") %>
113 <% end -%>
114 <% if @no_new_privileges -%>
115 NoNewPrivileges=<%= @no_new_privileges %>
116 <% end -%>
117 <% if @tasks_max -%>
118 TasksMax=<%= @tasks_max %>
119 <% end -%>
120 <% if @success_exit_status -%>
121 SuccessExitStatus=<%= Array(@success_exit_status).join(" ") %>
122 <% end -%>
123 <% if @restart -%>
124 Restart=<%= @restart %>
125 <% end -%>
126 <% if @timeout_sec -%>
127 TimeoutSec=<%= @timeout_sec %>
128 <% end -%>
129 <% if @pid_file -%>
130 PIDFile=<%= @pid_file %>
131 <% end -%>
132 <% if @nice -%>
133 Nice=<%= @nice %>
134 <% end -%>
135 <% if @io_scheduling_class -%>
136 IOSchedulingClass=<%= @io_scheduling_class %>
137 <% end -%>
138 <% if @io_scheduling_priority -%>
139 IOSchedulingPriority=<%= @io_scheduling_priority %>
140 <% end -%>
141 <% if @kill_mode -%>
142 KillMode=<%= @kill_mode %>
143 <% end -%>
144 <% unless @dropin -%>
145
146 [Install]
147 WantedBy=multi-user.target
148 <% end -%>