]>
Commit | Line | Data |
---|---|---|
d1ab0ca0 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?> | |
3 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
4 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
5 | ||
6 | <!-- | |
7 | This file is part of systemd. | |
8 | ||
9 | Copyright 2010 Lennart Poettering | |
10 | ||
11 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
12 | under the terms of the GNU Lesser General Public License as published by |
13 | the Free Software Foundation; either version 2.1 of the License, or | |
d1ab0ca0 LP |
14 | (at your option) any later version. |
15 | ||
16 | systemd is distributed in the hope that it will be useful, but | |
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 19 | Lesser General Public License for more details. |
d1ab0ca0 | 20 | |
5430f7f2 | 21 | You should have received a copy of the GNU Lesser General Public License |
d1ab0ca0 LP |
22 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
23 | --> | |
24 | ||
25 | <refentry id="systemd.service"> | |
26 | <refentryinfo> | |
27 | <title>systemd.service</title> | |
28 | <productname>systemd</productname> | |
29 | ||
30 | <authorgroup> | |
31 | <author> | |
32 | <contrib>Developer</contrib> | |
33 | <firstname>Lennart</firstname> | |
34 | <surname>Poettering</surname> | |
35 | <email>lennart@poettering.net</email> | |
36 | </author> | |
37 | </authorgroup> | |
38 | </refentryinfo> | |
39 | ||
40 | <refmeta> | |
41 | <refentrytitle>systemd.service</refentrytitle> | |
42 | <manvolnum>5</manvolnum> | |
43 | </refmeta> | |
44 | ||
45 | <refnamediv> | |
46 | <refname>systemd.service</refname> | |
47 | <refpurpose>systemd service configuration files</refpurpose> | |
48 | </refnamediv> | |
49 | ||
50 | <refsynopsisdiv> | |
51 | <para><filename>systemd.service</filename></para> | |
52 | </refsynopsisdiv> | |
53 | ||
54 | <refsect1> | |
55 | <title>Description</title> | |
56 | ||
1f812fea | 57 | <para>A unit configuration file whose name ends in |
65232ea7 LP |
58 | <filename>.service</filename> encodes information |
59 | about a process controlled and supervised by | |
60 | systemd.</para> | |
d1ab0ca0 LP |
61 | |
62 | <para>This man page lists the configuration options | |
63 | specific to this unit type. See | |
64 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
65 | for the common options of all unit configuration | |
0d624a78 | 66 | files. The common configuration items are configured |
62adf224 LP |
67 | in the generic <literal>[Unit]</literal> and |
68 | <literal>[Install]</literal> sections. The service | |
69 | specific configuration options are configured in the | |
70 | <literal>[Service]</literal> section.</para> | |
0d624a78 | 71 | |
ba60f905 LP |
72 | <para>Additional options are listed in |
73 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
74 | which define the execution environment the commands | |
75 | are executed in.</para> | |
62adf224 LP |
76 | |
77 | <para>Unless <varname>DefaultDependencies=</varname> | |
78 | is set to <option>false</option>, service units will | |
79 | implicitly have dependencies of type | |
80 | <varname>Requires=</varname> and | |
81 | <varname>After=</varname> on | |
82 | <filename>basic.target</filename> as well as | |
83 | dependencies of type <varname>Conflicts=</varname> and | |
84 | <varname>Before=</varname> on | |
85 | <filename>shutdown.target</filename>. These ensure | |
86 | that normal service units pull in basic system | |
87 | initialization, and are terminated cleanly prior to | |
88 | system shutdown. Only services involved with early | |
89 | boot or late system shutdown should disable this | |
90 | option.</para> | |
59a3e1bc LP |
91 | |
92 | <para>If a service is requested under a certain name | |
93 | but no unit configuration file is found, systemd looks | |
94 | for a SysV init script by the same name (with the | |
95 | <filename>.service</filename> suffix removed) and | |
96 | dynamically creates a service unit from that | |
97 | script. This is useful for compatibility with | |
98 | SysV.</para> | |
d1ab0ca0 LP |
99 | </refsect1> |
100 | ||
101 | <refsect1> | |
102 | <title>Options</title> | |
103 | ||
62adf224 LP |
104 | <para>Service files must include a |
105 | <literal>[Service]</literal> section, which carries | |
106 | information about the service and the process it | |
107 | supervises. A number of options that may be used in | |
108 | this section are shared with other unit types. These | |
109 | options are documented in | |
0d624a78 | 110 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The |
62adf224 LP |
111 | options specific to the <literal>[Service]</literal> |
112 | section of service units are the following:</para> | |
0d624a78 | 113 | |
d1ab0ca0 LP |
114 | <variablelist> |
115 | <varlistentry> | |
116 | <term><varname>Type=</varname></term> | |
0d624a78 LP |
117 | |
118 | <listitem><para>Configures the process | |
119 | start-up type for this service | |
120 | unit. One of <option>simple</option>, | |
121 | <option>forking</option>, | |
34e9ba66 | 122 | <option>oneshot</option>, |
0d624a78 | 123 | <option>dbus</option>, |
a8ad0f89 LP |
124 | <option>notify</option> or |
125 | <option>idle</option>.</para> | |
0d624a78 LP |
126 | |
127 | <para>If set to | |
128 | <option>simple</option> (the default | |
129 | value) it is expected that the process | |
130 | configured with | |
131 | <varname>ExecStart=</varname> is the | |
132 | main process of the service. In this | |
b1690fe7 LP |
133 | mode, if the process offers |
134 | functionality to other processes on | |
135 | the system its communication channels | |
136 | should be installed before the daemon | |
137 | is started up (e.g. sockets set up by | |
138 | systemd, via socket activation), as | |
139 | systemd will immediately proceed | |
140 | starting follow-up units.</para> | |
0d624a78 LP |
141 | |
142 | <para>If set to | |
143 | <option>forking</option> it is | |
144 | expected that the process configured | |
145 | with <varname>ExecStart=</varname> | |
b1690fe7 LP |
146 | will call <function>fork()</function> |
147 | as part of its start-up. The parent process is | |
148 | expected to exit when start-up is | |
149 | complete and all communication | |
150 | channels set up. The child continues | |
151 | to run as the main daemon | |
152 | process. This is the behaviour of | |
153 | traditional UNIX daemons. If this | |
0d624a78 LP |
154 | setting is used, it is recommended to |
155 | also use the | |
156 | <varname>PIDFile=</varname> option, so | |
157 | that systemd can identify the main | |
158 | process of the daemon. systemd will | |
159 | proceed starting follow-up units as | |
160 | soon as the parent process | |
161 | exits.</para> | |
162 | ||
163 | <para>Behaviour of | |
34e9ba66 | 164 | <option>oneshot</option> is similar |
0d624a78 LP |
165 | to <option>simple</option>, however |
166 | it is expected that the process has to | |
167 | exit before systemd starts follow-up | |
02ee865a | 168 | units. <varname>RemainAfterExit=</varname> |
0d624a78 LP |
169 | is particularly useful for this type |
170 | of service.</para> | |
171 | ||
172 | <para>Behaviour of | |
173 | <option>dbus</option> is similar to | |
62adf224 LP |
174 | <option>simple</option>, however it is |
175 | expected that the daemon acquires a | |
0d624a78 LP |
176 | name on the D-Bus bus, as configured |
177 | by | |
178 | <varname>BusName=</varname>. systemd | |
179 | will proceed starting follow-up units | |
180 | after the D-Bus bus name has been | |
62adf224 | 181 | acquired. Service units with this |
b1690fe7 | 182 | option configured implicitly gain |
62adf224 | 183 | dependencies on the |
177b3ffe | 184 | <filename>dbus.socket</filename> |
62adf224 | 185 | unit.</para> |
0d624a78 LP |
186 | |
187 | <para>Behaviour of | |
188 | <option>notify</option> is similar to | |
189 | <option>simple</option>, however it is | |
190 | expected that the daemon sends a | |
191 | notification message via | |
192 | <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
193 | or an equivalent call when it finished | |
194 | starting up. systemd will proceed | |
195 | starting follow-up units after this | |
196 | notification message has been sent. If | |
197 | this option is used | |
62adf224 | 198 | <varname>NotifyAccess=</varname> (see |
b1690fe7 | 199 | below) should be set to open access to |
0d624a78 | 200 | the notification socket provided by |
62adf224 | 201 | systemd. If |
02c4ef9c LP |
202 | <varname>NotifyAccess=</varname> is |
203 | not set, it will be implicitly set to | |
62adf224 | 204 | <option>main</option>.</para> |
a8ad0f89 LP |
205 | |
206 | <para>Behaviour of | |
207 | <option>idle</option> is very similar | |
349b915d | 208 | to <option>simple</option>, however |
a8ad0f89 LP |
209 | actual execution of a the service |
210 | binary is delayed until all jobs are | |
211 | dispatched. This may be used to avoid | |
212 | interleaving of output of shell | |
213 | services with the status output on the | |
214 | console.</para> | |
d1ab0ca0 LP |
215 | </listitem> |
216 | </varlistentry> | |
0d624a78 | 217 | |
d1ab0ca0 | 218 | <varlistentry> |
02ee865a | 219 | <term><varname>RemainAfterExit=</varname></term> |
0d624a78 LP |
220 | |
221 | <listitem><para>Takes a boolean value | |
222 | that specifies whether the service | |
223 | shall be considered active even when | |
224 | all its processes exited. Defaults to | |
225 | <option>no</option>.</para> | |
d1ab0ca0 | 226 | </listitem> |
3185a36b LP |
227 | </varlistentry> |
228 | ||
229 | <varlistentry> | |
230 | <term><varname>GuessMainPID=</varname></term> | |
231 | ||
232 | <listitem><para>Takes a boolean value | |
233 | that specifies whether systemd should | |
234 | try to guess the main PID of a service | |
235 | should if it cannot be determined | |
236 | reliably. This option is ignored | |
237 | unless <option>Type=forking</option> | |
238 | is set and <option>PIDFile=</option> | |
239 | is unset because for the other types | |
240 | or with an explicitly configured PID | |
241 | file the main PID is always known. The | |
242 | guessing algorithm might come to | |
243 | incorrect conclusions if a daemon | |
244 | consists of more than one process. If | |
245 | the main PID cannot be determined | |
246 | failure detection and automatic | |
247 | restarting of a service will not work | |
248 | reliably. Defaults to | |
249 | <option>yes</option>.</para> | |
250 | </listitem> | |
d1ab0ca0 LP |
251 | </varlistentry> |
252 | ||
253 | <varlistentry> | |
254 | <term><varname>PIDFile=</varname></term> | |
0d624a78 LP |
255 | |
256 | <listitem><para>Takes an absolute file | |
257 | name pointing to the PID file of this | |
258 | daemon. Use of this option is | |
259 | recommended for services where | |
260 | <varname>Type=</varname> is set to | |
be039669 LP |
261 | <option>forking</option>. systemd will |
262 | read the PID of the main process of | |
263 | the daemon after start-up of the | |
264 | service. systemd will not write to the | |
265 | file configured here.</para> | |
d1ab0ca0 LP |
266 | </listitem> |
267 | </varlistentry> | |
268 | ||
269 | <varlistentry> | |
270 | <term><varname>BusName=</varname></term> | |
0d624a78 LP |
271 | |
272 | <listitem><para>Takes a D-Bus bus | |
273 | name, where this service is reachable | |
274 | as. This option is mandatory for | |
275 | services where | |
276 | <varname>Type=</varname> is set to | |
277 | <option>dbus</option>, but its use | |
278 | is otherwise recommended as well if | |
279 | the process takes a name on the D-Bus | |
280 | bus.</para> | |
d1ab0ca0 LP |
281 | </listitem> |
282 | </varlistentry> | |
283 | ||
284 | <varlistentry> | |
285 | <term><varname>ExecStart=</varname></term> | |
0d624a78 LP |
286 | <listitem><para>Takes a command line |
287 | that is executed when this service | |
288 | shall be started up. The first token | |
289 | of the command line must be an | |
290 | absolute file name, then followed by | |
291 | arguments for the process. It is | |
292 | mandatory to set this option for all | |
293 | services. This option may not be | |
b1690fe7 LP |
294 | specified more than once, except when |
295 | <varname>Type=oneshot</varname> is | |
296 | used in which case more than one | |
297 | <varname>ExecStart=</varname> line is | |
298 | accepted which are then invoked one by | |
299 | one, sequentially in the order they | |
300 | appear in the unit file.</para> | |
301 | ||
302 | <para>Optionally, if the absolute file | |
303 | name is prefixed with | |
304 | <literal>@</literal>, the second token | |
305 | will be passed as | |
62adf224 LP |
306 | <literal>argv[0]</literal> to the |
307 | executed process, followed by the | |
b708e7ce LP |
308 | further arguments specified. If the |
309 | first token is prefixed with | |
b1690fe7 | 310 | <literal>-</literal> an exit code of |
b708e7ce | 311 | the command normally considered a |
b1690fe7 | 312 | failure (i.e. non-zero exit status or |
5471472d | 313 | abnormal exit due to signal) is ignored |
b1690fe7 LP |
314 | and considered success. If both |
315 | <literal>-</literal> and | |
316 | <literal>@</literal> are used for the | |
5471472d | 317 | same command the former must precede |
b1690fe7 | 318 | the latter. Unless |
420a0166 LP |
319 | <varname>Type=forking</varname> is |
320 | set, the process started via this | |
321 | command line will be considered the | |
322 | main process of the daemon. The | |
323 | command line accepts % specifiers as | |
324 | described in | |
7734f773 BS |
325 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> |
326 | ||
327 | <para>On top of that basic environment | |
328 | variable substitution is | |
329 | supported. Use | |
330 | <literal>${FOO}</literal> as part of a | |
331 | word, or as word of its own on the | |
332 | command line, in which case it will be | |
333 | replaced by the value of the | |
334 | environment variable including all | |
335 | whitespace it contains, resulting in a | |
336 | single argument. Use | |
337 | <literal>$FOO</literal> as a separate | |
338 | word on the command line, in which | |
339 | case it will be replaced by the value | |
340 | of the environment variable split up | |
341 | at whitespace, resulting in no or more | |
342 | arguments. Note that the first | |
343 | argument (i.e. the program to execute) | |
344 | may not be a variable, and must be a | |
345 | literal and absolute path | |
346 | name.</para></listitem> | |
0d624a78 LP |
347 | </varlistentry> |
348 | ||
349 | <varlistentry> | |
350 | <term><varname>ExecStartPre=</varname></term> | |
351 | <term><varname>ExecStartPost=</varname></term> | |
352 | <listitem><para>Additional commands | |
353 | that are executed before (resp. after) | |
354 | the command in | |
b3eaa628 LP |
355 | <varname>ExecStart=</varname>. Multiple |
356 | command lines may be concatenated in a | |
c899f8c6 | 357 | single directive, by separating them |
b3eaa628 | 358 | by semicolons (these semicolons must |
96d4ce01 | 359 | be passed as separate words). In that |
b3eaa628 LP |
360 | case, the commands are executed one |
361 | after the other, | |
362 | serially. Alternatively, these | |
363 | directives may be specified more than | |
5471472d | 364 | once with the same effect. However, |
b3eaa628 LP |
365 | the latter syntax is not recommended |
366 | for compatibility with parsers | |
367 | suitable for XDG | |
368 | <filename>.desktop</filename> files. | |
369 | Use of these settings is | |
420a0166 LP |
370 | optional. Specifier and environment |
371 | variable substitution is | |
372 | supported.</para></listitem> | |
0d624a78 LP |
373 | </varlistentry> |
374 | ||
375 | <varlistentry> | |
376 | <term><varname>ExecReload=</varname></term> | |
377 | <listitem><para>Commands to execute to | |
378 | trigger a configuration reload in the | |
b3eaa628 LP |
379 | service. This argument takes multiple |
380 | command lines, following the same | |
381 | scheme as pointed out for | |
382 | <varname>ExecStartPre=</varname> | |
383 | above. Use of this setting is | |
420a0166 LP |
384 | optional. Specifier and environment |
385 | variable substitution is supported | |
386 | here following the same scheme as for | |
387 | <varname>ExecStart=</varname>. One | |
388 | special environment variable is set: | |
389 | if known <literal>$MAINPID</literal> is | |
390 | set to the main process of the | |
391 | daemon, and may be used for command | |
392 | lines like the following: | |
393 | <command>/bin/kill -HUP | |
075b1e86 | 394 | $MAINPID</command>.</para></listitem> |
0d624a78 LP |
395 | </varlistentry> |
396 | ||
397 | <varlistentry> | |
398 | <term><varname>ExecStop=</varname></term> | |
399 | <listitem><para>Commands to execute to | |
400 | stop the service started via | |
b3eaa628 LP |
401 | <varname>ExecStart=</varname>. This |
402 | argument takes multiple command lines, | |
403 | following the same scheme as pointed | |
404 | out for | |
405 | <varname>ExecStartPre=</varname> | |
406 | above. Use of this setting is | |
0d624a78 LP |
407 | optional. All processes remaining for |
408 | a service after the commands | |
409 | configured in this option are run are | |
410 | terminated according to the | |
411 | <varname>KillMode=</varname> setting | |
412 | (see below). If this option is not | |
413 | specified the process is terminated | |
414 | right-away when service stop is | |
420a0166 LP |
415 | requested. Specifier and environment |
416 | variable substitution is supported | |
417 | (including | |
075b1e86 | 418 | <literal>$MAINPID</literal>, see |
420a0166 | 419 | above).</para></listitem> |
0d624a78 LP |
420 | </varlistentry> |
421 | ||
422 | <varlistentry> | |
423 | <term><varname>ExecStopPost=</varname></term> | |
424 | <listitem><para>Additional commands | |
425 | that are executed after the service | |
426 | was stopped using the commands | |
427 | configured in | |
b3eaa628 LP |
428 | <varname>ExecStop=</varname>. This |
429 | argument takes multiple command lines, | |
430 | following the same scheme as pointed | |
431 | out for | |
432 | <varname>ExecStartPre</varname>. Use | |
433 | of these settings is | |
420a0166 LP |
434 | optional. Specifier and environment |
435 | variable substitution is | |
436 | supported.</para></listitem> | |
0d624a78 LP |
437 | </varlistentry> |
438 | ||
439 | <varlistentry> | |
440 | <term><varname>RestartSec=</varname></term> | |
441 | <listitem><para>Configures the time to | |
442 | sleep before restarting a service (as | |
443 | configured with | |
444 | <varname>Restart=</varname>). Takes a | |
445 | unit-less value in seconds, or a time | |
446 | span value such as "5min | |
447 | 20s". Defaults to | |
448 | 100ms.</para></listitem> | |
449 | </varlistentry> | |
450 | ||
451 | <varlistentry> | |
452 | <term><varname>TimeoutSec=</varname></term> | |
453 | <listitem><para>Configures the time to | |
454 | wait for start-up and stop. If a | |
455 | daemon service does not signal | |
456 | start-up completion within the | |
457 | configured time the service will be | |
458 | considered failed and be shut down | |
459 | again. If a service is asked to stop | |
460 | but does not terminate in the | |
461 | specified time it will be terminated | |
462 | forcibly via SIGTERM, and after | |
463 | another delay of this time with | |
464 | SIGKILL. (See | |
62adf224 | 465 | <varname>KillMode=</varname> |
0d624a78 LP |
466 | below.) Takes a unit-less value in seconds, or a |
467 | time span value such as "5min | |
468 | 20s". Pass 0 to disable the timeout | |
469 | logic. Defaults to | |
ecb963cc | 470 | 90s.</para></listitem> |
0d624a78 LP |
471 | </varlistentry> |
472 | ||
bb242b7b MO |
473 | <varlistentry> |
474 | <term><varname>WatchdogSec=</varname></term> | |
e8ab3ccb LP |
475 | <listitem><para>Configures the |
476 | watchdog timeout for a service. This | |
477 | is activated when the start-up is | |
478 | completed. The service must call | |
bb242b7b | 479 | <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry> |
e8ab3ccb LP |
480 | regularly with "WATCHDOG=1". If the |
481 | time between two such calls is larger | |
482 | than the configured time then the | |
483 | service is placed in a failure | |
484 | state. By setting | |
2707271e | 485 | <varname>Restart=</varname> |
bb242b7b | 486 | to <option>on-failure</option> or |
e8ab3ccb LP |
487 | <option>always</option> the service |
488 | will be automatically restarted. The | |
489 | time configured here will be passed to | |
490 | the executed service process in the | |
491 | <varname>WATCHDOG_USEC=</varname> | |
02c4ef9c LP |
492 | environment variable. If |
493 | this option is used | |
494 | <varname>NotifyAccess=</varname> (see | |
495 | below) should be set to open access to | |
496 | the notification socket provided by | |
497 | systemd. If | |
498 | <varname>NotifyAccess=</varname> is not | |
499 | set, it will be implicitly set to | |
500 | <option>main</option>. Defaults to 0, | |
e8ab3ccb LP |
501 | which disables this |
502 | feature.</para></listitem> | |
bb242b7b MO |
503 | </varlistentry> |
504 | ||
0d624a78 LP |
505 | <varlistentry> |
506 | <term><varname>Restart=</varname></term> | |
507 | <listitem><para>Configures whether the | |
50caaedb | 508 | main service process shall be |
f8553ccb | 509 | restarted when it exits. Takes one of |
525ee6f4 | 510 | <option>no</option>, |
50caaedb LP |
511 | <option>on-success</option>, |
512 | <option>on-failure</option>, | |
513 | <option>on-abort</option> or | |
514 | <option>always</option>. If set to | |
515 | <option>no</option> (the default) the | |
516 | service will not be restarted when it | |
517 | exits. If set to | |
518 | <option>on-success</option> it will be | |
519 | restarted only when it exited cleanly, | |
520 | i.e. terminated with an exit code of | |
521 | 0. If set to | |
522 | <option>on-failure</option> it will be | |
5471472d | 523 | restarted only when it exited with an |
092317d0 LP |
524 | exit code not equalling 0, when |
525 | terminated by a signal, when an | |
526 | operation times out or when the | |
527 | configured watchdog timeout is | |
528 | triggered. If set to | |
50caaedb LP |
529 | <option>on-abort</option> it will be |
530 | restarted only if it exits due to | |
531 | reception of an uncaught signal. If | |
532 | set to <option>always</option> the | |
0d624a78 | 533 | service will be restarted regardless |
092317d0 | 534 | whether it exited cleanly or not, |
0d624a78 | 535 | got terminated abnormally by a |
092317d0 | 536 | signal or hit a timeout.</para></listitem> |
0d624a78 LP |
537 | </varlistentry> |
538 | ||
539 | <varlistentry> | |
540 | <term><varname>PermissionsStartOnly=</varname></term> | |
541 | <listitem><para>Takes a boolean | |
542 | argument. If true, the permission | |
543 | related execution options as | |
544 | configured with | |
545 | <varname>User=</varname> and similar | |
546 | options (see | |
547 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
548 | for more information) are only applied | |
549 | to the process started with | |
550 | <varname>ExecStart=</varname>, and not | |
551 | to the various other | |
552 | <varname>ExecStartPre=</varname>, | |
553 | <varname>ExecStartPost=</varname>, | |
554 | <varname>ExecReload=</varname>, | |
555 | <varname>ExecStop=</varname>, | |
556 | <varname>ExecStopPost=</varname> | |
557 | commands. If false, the setting is | |
558 | applied to all configured commands the | |
559 | same way. Defaults to | |
560 | false.</para></listitem> | |
561 | </varlistentry> | |
562 | ||
563 | <varlistentry> | |
564 | <term><varname>RootDirectoryStartOnly=</varname></term> | |
565 | <listitem><para>Takes a boolean | |
566 | argument. If true, the root directory | |
567 | as configured with the | |
568 | <varname>RootDirectory=</varname> | |
569 | option (see | |
570 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
571 | for more information) is only applied | |
572 | to the process started with | |
573 | <varname>ExecStart=</varname>, and not | |
574 | to the various other | |
575 | <varname>ExecStartPre=</varname>, | |
576 | <varname>ExecStartPost=</varname>, | |
577 | <varname>ExecReload=</varname>, | |
578 | <varname>ExecStop=</varname>, | |
579 | <varname>ExecStopPost=</varname> | |
580 | commands. If false, the setting is | |
581 | applied to all configured commands the | |
582 | same way. Defaults to | |
583 | false.</para></listitem> | |
584 | </varlistentry> | |
585 | ||
586 | <varlistentry> | |
587 | <term><varname>SysVStartPriority=</varname></term> | |
588 | <listitem><para>Set the SysV start | |
589 | priority to use to order this service | |
590 | in relation to SysV services lacking | |
591 | LSB headers. This option is only | |
592 | necessary to fix ordering in relation | |
593 | to legacy SysV services, that have no | |
594 | ordering information encoded in the | |
595 | script headers. As such it should only | |
596 | be used as temporary compatibility | |
597 | option, and not be used in new unit | |
598 | files. Almost always it is a better | |
599 | choice to add explicit ordering | |
600 | directives via | |
601 | <varname>After=</varname> or | |
602 | <varname>Before=</varname>, | |
603 | instead. For more details see | |
604 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. If | |
605 | used, pass an integer value in the | |
606 | range 0-99.</para></listitem> | |
607 | </varlistentry> | |
608 | ||
609 | <varlistentry> | |
610 | <term><varname>KillMode=</varname></term> | |
611 | <listitem><para>Specifies how | |
612 | processes of this service shall be | |
613 | killed. One of | |
614 | <option>control-group</option>, | |
0d624a78 LP |
615 | <option>process</option>, |
616 | <option>none</option>.</para> | |
617 | ||
618 | <para>If set to | |
619 | <option>control-group</option> all | |
620 | remaining processes in the control | |
621 | group of this service will be | |
622 | terminated on service stop, after the | |
623 | stop command (as configured with | |
624 | <varname>ExecStop=</varname>) is | |
625 | executed. If set to | |
0d624a78 LP |
626 | <option>process</option> only the main |
627 | process itself is killed. If set to | |
628 | <option>none</option> no process is | |
629 | killed. In this case only the stop | |
630 | command will be executed on service | |
631 | stop, but no process be killed | |
632 | otherwise. Processes remaining alive | |
633 | after stop are left in their control | |
634 | group and the control group continues | |
635 | to exist after stop unless it is | |
636 | empty. Defaults to | |
f8553ccb | 637 | <option>control-group</option>.</para> |
0d624a78 LP |
638 | |
639 | <para>Processes will first be | |
ba035df2 LP |
640 | terminated via SIGTERM (unless the |
641 | signal to send is changed via | |
2292707d LP |
642 | <varname>KillSignal=</varname>). If |
643 | then after a delay (configured via the | |
62adf224 | 644 | <varname>TimeoutSec=</varname> option) |
0d624a78 LP |
645 | processes still remain, the |
646 | termination request is repeated with | |
ba035df2 LP |
647 | the SIGKILL signal (unless this is |
648 | disabled via the | |
649 | <varname>SendSIGKILL=</varname> | |
650 | option). See | |
0d624a78 LP |
651 | <citerefentry><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry> |
652 | for more | |
653 | information.</para></listitem> | |
654 | </varlistentry> | |
655 | ||
2292707d LP |
656 | <varlistentry> |
657 | <term><varname>KillSignal=</varname></term> | |
658 | <listitem><para>Specifies which signal | |
659 | to use when killing a | |
660 | service. Defaults to SIGTERM. | |
661 | </para></listitem> | |
662 | </varlistentry> | |
663 | ||
ba035df2 LP |
664 | <varlistentry> |
665 | <term><varname>SendSIGKILL=</varname></term> | |
666 | <listitem><para>Specifies whether to | |
667 | send SIGKILL to remaining processes | |
668 | after a timeout, if the normal | |
669 | shutdown procedure left processes of | |
670 | the service around. Takes a boolean | |
671 | value. Defaults to "yes". | |
672 | </para></listitem> | |
673 | </varlistentry> | |
674 | ||
0d624a78 LP |
675 | <varlistentry> |
676 | <term><varname>NonBlocking=</varname></term> | |
677 | <listitem><para>Set O_NONBLOCK flag | |
678 | for all file descriptors passed via | |
679 | socket-based activation. If true, all | |
680 | file descriptors >= 3 (i.e. all except | |
681 | STDIN/STDOUT/STDERR) will have | |
682 | the O_NONBLOCK flag set and hence are in | |
683 | non-blocking mode. This option is only | |
684 | useful in conjunction with a socket | |
685 | unit, as described in | |
686 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Defaults | |
687 | to false.</para></listitem> | |
688 | </varlistentry> | |
689 | ||
690 | <varlistentry> | |
691 | <term><varname>NotifyAccess=</varname></term> | |
692 | <listitem><para>Controls access to the | |
693 | service status notification socket, as | |
694 | accessible via the | |
695 | <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
696 | call. Takes one of | |
697 | <option>none</option> (the default), | |
698 | <option>main</option> or | |
699 | <option>all</option>. If | |
700 | <option>none</option> no daemon status | |
f8553ccb | 701 | updates are accepted from the service |
0d624a78 LP |
702 | processes, all status update messages |
703 | are ignored. If <option>main</option> | |
704 | only service updates sent from the | |
705 | main process of the service are | |
706 | accepted. If <option>all</option> all | |
707 | services updates from all members of | |
708 | the service's control group are | |
02c4ef9c | 709 | accepted. This option should be set to |
0d624a78 LP |
710 | open access to the notification socket |
711 | when using | |
02c4ef9c LP |
712 | <varname>Type=notify</varname> or |
713 | <varname>WatchdogUsec=</varname> (see | |
714 | above). If those options are used but | |
715 | <varname>NotifyAccess=</varname> not | |
716 | configured it will be implicitly set | |
717 | to | |
718 | <option>main</option>.</para></listitem> | |
d1ab0ca0 LP |
719 | </varlistentry> |
720 | ||
f72192c0 LP |
721 | <varlistentry> |
722 | <term><varname>Sockets=</varname></term> | |
723 | <listitem><para>Specifies the name of | |
724 | the socket units this service shall | |
725 | inherit the sockets from when the | |
4f025f4c | 726 | service is started. Normally it |
f72192c0 LP |
727 | should not be necessary to use this |
728 | setting as all sockets whose unit | |
729 | shares the same name as the service | |
4f025f4c | 730 | (ignoring the different suffix of course) |
f72192c0 LP |
731 | are passed to the spawned |
732 | process.</para> | |
733 | ||
734 | <para>Note that the same socket may be | |
735 | passed to multiple processes at the | |
736 | same time. Also note that a different | |
737 | service may be activated on incoming | |
738 | traffic than inherits the sockets. Or | |
739 | in other words: The | |
740 | <varname>Service=</varname> setting of | |
741 | <filename>.socket</filename> units | |
742 | doesn't have to match the inverse of the | |
a1102c1f | 743 | <varname>Sockets=</varname> setting of |
f72192c0 LP |
744 | the <filename>.service</filename> it |
745 | refers to.</para></listitem> | |
746 | </varlistentry> | |
747 | ||
2ba545f1 LP |
748 | <varlistentry> |
749 | <term><varname>FsckPassNo=</varname></term> | |
750 | <listitem><para>Set the fsck passno | |
751 | priority to use to order this service | |
752 | in relation to other file system | |
753 | checking services. This option is only | |
754 | necessary to fix ordering in relation | |
755 | to fsck jobs automatically created for | |
756 | all <filename>/etc/fstab</filename> | |
757 | entries with a value in the fs_passno | |
758 | column > 0. As such it should only be | |
759 | used as option for fsck | |
760 | services. Almost always it is a better | |
761 | choice to add explicit ordering | |
762 | directives via | |
763 | <varname>After=</varname> or | |
764 | <varname>Before=</varname>, | |
765 | instead. For more details see | |
766 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. If | |
767 | used, pass an integer value in the | |
768 | same range as | |
769 | <filename>/etc/fstab</filename>'s | |
770 | fs_passno column. See | |
771 | <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
772 | for details.</para></listitem> | |
773 | </varlistentry> | |
774 | ||
092317d0 LP |
775 | <varlistentry> |
776 | <term><varname>StartLimitInterval=</varname></term> | |
777 | <term><varname>StartLimitBurst=</varname></term> | |
778 | ||
779 | <listitem><para>Configure service | |
780 | start rate limiting. By default | |
781 | services which are started more often | |
782 | than 5 times within 10s are not | |
783 | permitted to start any more times | |
784 | until the 10s interval ends. With | |
785 | these two options this rate limiting | |
786 | may be modified. Use | |
787 | <varname>StartLimitInterval=</varname> | |
788 | to configure the checking interval | |
789 | (defaults to 10s, set to 0 to disable | |
790 | any kind of rate limiting). Use | |
791 | <varname>StartLimitBurst=</varname> to | |
792 | configure how many starts per interval | |
793 | are allowed (defaults to 5). These | |
794 | configuration options are particularly | |
795 | useful in conjunction with | |
796 | <varname>Restart=</varname>.</para></listitem> | |
797 | </varlistentry> | |
798 | ||
799 | <varlistentry> | |
800 | <term><varname>StartLimitAction=</varname></term> | |
801 | ||
802 | <listitem><para>Configure the action | |
803 | to take if the rate limit configured | |
804 | with | |
805 | <varname>StartLimitInterval=</varname> | |
806 | and | |
807 | <varname>StartLimitBurst=</varname> is | |
808 | hit. Takes one of | |
809 | <option>none</option>, | |
810 | <option>reboot</option>, | |
811 | <option>reboot-force</option> or | |
812 | <option>reboot-immediate</option>. If | |
813 | <option>none</option> is set, | |
814 | hitting the rate limit will trigger no | |
815 | action besides that the start will not | |
816 | be | |
817 | permitted. <option>reboot</option> | |
818 | causes a reboot following the normal | |
819 | shutdown procedure (i.e. equivalent to | |
820 | <command>systemctl reboot</command>), | |
821 | <option>reboot-force</option> causes | |
822 | an forced reboot which will terminate | |
823 | all processes forcibly but should | |
824 | cause no dirty file systems on reboot | |
825 | (i.e. equivalent to <command>systemctl | |
826 | reboot -f</command>) and | |
827 | <option>reboot-immediate</option> | |
828 | causes immediate execution of the | |
829 | <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> | |
830 | system call, which might result in | |
831 | data loss. Defaults to | |
832 | <option>none</option>.</para></listitem> | |
833 | </varlistentry> | |
834 | ||
d1ab0ca0 LP |
835 | </variablelist> |
836 | </refsect1> | |
837 | ||
838 | <refsect1> | |
839 | <title>See Also</title> | |
840 | <para> | |
f3e219a2 | 841 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
0d624a78 LP |
842 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
843 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
844 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
d1ab0ca0 LP |
845 | </para> |
846 | </refsect1> | |
847 | ||
848 | </refentry> |