]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.exec.xml
man: for ExecStart= provide more details on env var substitution and how that turns...
[thirdparty/systemd.git] / man / systemd.exec.xml
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
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
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
19 General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="systemd.exec">
26 <refentryinfo>
27 <title>systemd.exec</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.exec</refentrytitle>
42 <manvolnum>5</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.exec</refname>
47 <refpurpose>systemd execution environment configuration</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <para><filename>systemd.service</filename>,
52 <filename>systemd.socket</filename>,
53 <filename>systemd.mount</filename>,
54 <filename>systemd.swap</filename></para>
55 </refsynopsisdiv>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>Unit configuration files for services, sockets,
61 mount points and swap devices share a subset of
62 configuration options which define the execution
63 environment of spawned processes.</para>
64
65 <para>This man page lists the configuration options
66 shared by these four unit types. See
67 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
68 for the common options of all unit configuration
69 files, and
70 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
71 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
72 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>
73 and
74 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
75 for more information on the specific unit
76 configuration files. The execution specific
77 configuration options are configured in the [Service],
78 [Socket], [Mount] resp. [Swap] section, depending on the unit
79 type.</para>
80 </refsect1>
81
82 <refsect1>
83 <title>Options</title>
84
85 <variablelist>
86
87 <varlistentry>
88 <term><varname>WorkingDirectory=</varname></term>
89
90 <listitem><para>Takes an absolute
91 directory path. Sets the working
92 directory for executed
93 processes.</para></listitem>
94 </varlistentry>
95
96 <varlistentry>
97 <term><varname>RootDirectory=</varname></term>
98
99 <listitem><para>Takes an absolute
100 directory path. Sets the root
101 directory for executed processes, with
102 the
103 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
104 system call. If this is used it must
105 be ensured that the process and all
106 its auxiliary files are available in
107 the <function>chroot()</function>
108 jail.</para></listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term><varname>User=</varname></term>
113 <term><varname>Group=</varname></term>
114
115 <listitem><para>Sets the Unix user
116 resp. group the processes are executed
117 as. Takes a single user resp. group
118 name or ID as argument. If no group is
119 set the default group of the user is
120 chosen.</para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><varname>SupplementaryGroups=</varname></term>
125
126 <listitem><para>Sets the supplementary
127 Unix groups the processes are executed
128 as. This takes a space separated list
129 of group names or IDs. This option may
130 be specified more than once in which
131 case all listed groups are set as
132 supplementary groups. This option does
133 not override but extends the list of
134 supplementary groups configured in the
135 system group database for the
136 user.</para></listitem>
137 </varlistentry>
138
139 <varlistentry>
140 <term><varname>Nice=</varname></term>
141
142 <listitem><para>Sets the default nice
143 level (scheduling priority) for
144 executed processes. Takes an integer
145 between -20 (highest priority) and 19
146 (lowest priority). See
147 <citerefentry><refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum></citerefentry>
148 for details.</para></listitem>
149 </varlistentry>
150
151 <varlistentry>
152 <term><varname>OOMScoreAdjust=</varname></term>
153
154 <listitem><para>Sets the adjustment
155 level for the Out-Of-Memory killer for
156 executed processes. Takes an integer
157 between -1000 (to disable OOM killing
158 for this process) and 1000 (to make
159 killing of this process under memory
160 pressure very likely). See <ulink
161 url="http://www.kernel.org/doc/Documentation/filesystems/proc.txt">proc.txt</ulink>
162 for details.</para></listitem>
163 </varlistentry>
164
165 <varlistentry>
166 <term><varname>IOSchedulingClass=</varname></term>
167
168 <listitem><para>Sets the IO scheduling
169 class for executed processes. Takes an
170 integer between 0 and 3 or one of the
171 strings <option>none</option>,
172 <option>realtime</option>,
173 <option>best-effort</option> or
174 <option>idle</option>. See
175 <citerefentry><refentrytitle>ioprio_set</refentrytitle><manvolnum>2</manvolnum></citerefentry>
176 for details.</para></listitem>
177 </varlistentry>
178
179 <varlistentry>
180 <term><varname>IOSchedulingPriority=</varname></term>
181
182 <listitem><para>Sets the IO scheduling
183 priority for executed processes. Takes
184 an integer between 0 (highest
185 priority) and 7 (lowest priority). The
186 available priorities depend on the
187 selected IO scheduling class (see
188 above). See
189 <citerefentry><refentrytitle>ioprio_set</refentrytitle><manvolnum>2</manvolnum></citerefentry>
190 for details.</para></listitem>
191 </varlistentry>
192
193 <varlistentry>
194 <term><varname>CPUSchedulingPolicy=</varname></term>
195
196 <listitem><para>Sets the CPU
197 scheduling policy for executed
198 processes. Takes one of
199 <option>other</option>,
200 <option>batch</option>,
201 <option>idle</option>,
202 <option>fifo</option> or
203 <option>rr</option>. See
204 <citerefentry><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry>
205 for details.</para></listitem>
206 </varlistentry>
207
208 <varlistentry>
209 <term><varname>CPUSchedulingPriority=</varname></term>
210
211 <listitem><para>Sets the CPU
212 scheduling priority for executed
213 processes. Takes an integer between 1
214 (lowest priority) and 99 (highest
215 priority). The available priority
216 range depends on the selected CPU
217 scheduling policy (see above). See
218 <citerefentry><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry>
219 for details.</para></listitem>
220 </varlistentry>
221
222 <varlistentry>
223 <term><varname>CPUSchedulingResetOnFork=</varname></term>
224
225 <listitem><para>Takes a boolean
226 argument. If true elevated CPU
227 scheduling priorities and policies
228 will be reset when the executed
229 processes fork, and can hence not leak
230 into child processes. See
231 <citerefentry><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry>
232 for details. Defaults to false.</para></listitem>
233 </varlistentry>
234
235 <varlistentry>
236 <term><varname>CPUAffinity=</varname></term>
237
238 <listitem><para>Controls the CPU
239 affinity of the executed
240 processes. Takes a space-separated
241 list of CPU indexes. See
242 <citerefentry><refentrytitle>sched_setaffinity</refentrytitle><manvolnum>2</manvolnum></citerefentry>
243 for details.</para></listitem>
244 </varlistentry>
245
246 <varlistentry>
247 <term><varname>UMask=</varname></term>
248
249 <listitem><para>Controls the file mode
250 creation mask. Takes an access mode in
251 octal notation. See
252 <citerefentry><refentrytitle>umask</refentrytitle><manvolnum>2</manvolnum></citerefentry>
253 for details. Defaults to
254 0022.</para></listitem>
255 </varlistentry>
256
257 <varlistentry>
258 <term><varname>Environment=</varname></term>
259
260 <listitem><para>Sets environment
261 variables for executed
262 processes. Takes a space-separated
263 list of variable assignments. This
264 option may be specified more than once
265 in which case all listed variables
266 will be set. If the same variable is
267 set twice the later setting will
268 override the earlier setting. See
269 <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>
270 for details.</para></listitem>
271 </varlistentry>
272 <varlistentry>
273 <term><varname>EnvironmentFile=</varname></term>
274 <listitem><para>Similar to
275 <varname>Environment=</varname> but
276 reads the environment variables from a
277 text file. The text file should
278 contain new-line separated variable
279 assignments. Empty lines and lines
280 starting with ; or # will be ignored,
281 which may be used for commenting. The
282 parser strips leading and
283 trailing whitespace from the values
284 of assignments, unless you use
285 double quotes (").
286 The
287 argument passed should be an absolute
288 file name, optionally prefixed with
289 "-", which indicates that if the file
290 does not exist it won't be read and no
291 error or warning message is
292 logged. The files listed with this
293 directive will be read shortly before
294 the process is executed. Settings from
295 these files override settings made
296 with
297 <varname>Environment=</varname>. If
298 the same variable is set twice from
299 these files the files will be read in
300 the order they are specified and the
301 later setting will override the
302 earlier setting. </para></listitem>
303 </varlistentry>
304
305 <varlistentry>
306 <term><varname>StandardInput=</varname></term>
307 <listitem><para>Controls where file
308 descriptor 0 (STDIN) of the executed
309 processes is connected to. Takes one
310 of <option>null</option>,
311 <option>tty</option>,
312 <option>tty-force</option>,
313 <option>tty-fail</option> or
314 <option>socket</option>. If
315 <option>null</option> is selected
316 standard input will be connected to
317 <filename>/dev/null</filename>,
318 i.e. all read attempts by the process
319 will result in immediate EOF. If
320 <option>tty</option> is selected
321 standard input is connected to a TTY
322 (as configured by
323 <varname>TTYPath=</varname>, see
324 below) and the executed process
325 becomes the controlling process of the
326 terminal. If the terminal is already
327 being controlled by another process the
328 executed process waits until the current
329 controlling process releases the
330 terminal.
331 <option>tty-force</option>
332 is similar to <option>tty</option>,
333 but the executed process is forcefully
334 and immediately made the controlling
335 process of the terminal, potentially
336 removing previous controlling
337 processes from the
338 terminal. <option>tty-fail</option> is
339 similar to <option>tty</option> but if
340 the terminal already has a controlling
341 process start-up of the executed
342 process fails. The
343 <option>socket</option> option is only
344 valid in socket-activated services,
345 and only when the socket configuration
346 file (see
347 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>
348 for details) specifies a single socket
349 only. If this option is set standard
350 input will be connected to the socket
351 the service was activated from, which
352 is primarily useful for compatibility
353 with daemons designed for use with the
354 traditional
355 <citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
356 daemon. This setting defaults to
357 <option>null</option>.</para></listitem>
358 </varlistentry>
359 <varlistentry>
360 <term><varname>StandardOutput=</varname></term>
361 <listitem><para>Controls where file
362 descriptor 1 (STDOUT) of the executed
363 processes is connected to. Takes one
364 of <option>inherit</option>,
365 <option>null</option>,
366 <option>tty</option>,
367 <option>syslog</option>,
368 <option>kmsg</option>,
369 <option>kmsg+console</option>,
370 <option>syslog+console</option> or
371 <option>socket</option>. If set to
372 <option>inherit</option> the file
373 descriptor of standard input is
374 duplicated for standard output. If set
375 to <option>null</option> standard
376 output will be connected to
377 <filename>/dev/null</filename>,
378 i.e. everything written to it will be
379 lost. If set to <option>tty</option>
380 standard output will be connected to a
381 tty (as configured via
382 <varname>TTYPath=</varname>, see
383 below). If the TTY is used for output
384 only the executed process will not
385 become the controlling process of the
386 terminal, and will not fail or wait
387 for other processes to release the
388 terminal. <option>syslog</option>
389 connects standard output to the
390 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
391 system syslog
392 service. <option>kmsg</option>
393 connects it with the kernel log buffer
394 which is accessible via
395 <citerefentry><refentrytitle>dmesg</refentrytitle><manvolnum>1</manvolnum></citerefentry>. <option>syslog+console</option>
396 and <option>kmsg+console</option> work
397 similarly but copy the output to the
398 system console as
399 well. <option>socket</option> connects
400 standard output to a socket from
401 socket activation, semantics are
402 similar to the respective option of
403 <varname>StandardInput=</varname>.
404 This setting defaults to the value set
405 with
406 <option>DefaultStandardOutput=</option>
407 in
408 <citerefentry><refentrytitle>systemd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
409 which defaults to
410 <option>syslog</option>.</para></listitem>
411 </varlistentry>
412 <varlistentry>
413 <term><varname>StandardError=</varname></term>
414 <listitem><para>Controls where file
415 descriptor 2 (STDERR) of the executed
416 processes is connected to. The
417 available options are identical to
418 those of
419 <varname>StandardOutput=</varname>,
420 with one exception: if set to
421 <option>inherit</option> the file
422 descriptor used for standard output is
423 duplicated for standard error. This
424 setting defaults to the value set with
425 <option>DefaultStandardError=</option>
426 in
427 <citerefentry><refentrytitle>systemd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
428 which defaults to
429 <option>inherit</option>.</para></listitem>
430 </varlistentry>
431 <varlistentry>
432 <term><varname>TTYPath=</varname></term>
433 <listitem><para>Sets the terminal
434 device node to use if standard input,
435 output or stderr are connected to a
436 TTY (see above). Defaults to
437 <filename>/dev/console</filename>.</para></listitem>
438 </varlistentry>
439 <varlistentry>
440 <term><varname>TTYReset=</varname></term>
441 <listitem><para>Reset the terminal
442 device specified with
443 <varname>TTYPath=</varname> before and
444 after execution. Defaults to
445 <literal>no</literal>.</para></listitem>
446 </varlistentry>
447 <varlistentry>
448 <term><varname>TTYVHangup=</varname></term>
449 <listitem><para>Disconnect all clients
450 which have opened the terminal device
451 specified with
452 <varname>TTYPath=</varname>
453 before and after execution. Defaults
454 to
455 <literal>no</literal>.</para></listitem>
456 </varlistentry>
457 <varlistentry>
458 <term><varname>TTYVTDisallocate=</varname></term>
459 <listitem><para>If the the terminal
460 device specified with
461 <varname>TTYPath=</varname> is a
462 virtual console terminal try to
463 deallocate the TTY before and after
464 execution. This ensures that the
465 screen and scrollback buffer is
466 cleared. Defaults to
467 <literal>no</literal>.</para></listitem>
468 </varlistentry>
469 <varlistentry>
470 <term><varname>SyslogIdentifier=</varname></term>
471 <listitem><para>Sets the process name
472 to prefix log lines sent to syslog or
473 the kernel log buffer with. If not set
474 defaults to the process name of the
475 executed process. This option is only
476 useful when
477 <varname>StandardOutput=</varname> or
478 <varname>StandardError=</varname> are
479 set to <option>syslog</option> or
480 <option>kmsg</option>.</para></listitem>
481 </varlistentry>
482 <varlistentry>
483 <term><varname>SyslogFacility=</varname></term>
484 <listitem><para>Sets the syslog
485 facility to use when logging to
486 syslog. One of <option>kern</option>,
487 <option>user</option>,
488 <option>mail</option>,
489 <option>daemon</option>,
490 <option>auth</option>,
491 <option>syslog</option>,
492 <option>lpr</option>,
493 <option>news</option>,
494 <option>uucp</option>,
495 <option>cron</option>,
496 <option>authpriv</option>,
497 <option>ftp</option>,
498 <option>local0</option>,
499 <option>local1</option>,
500 <option>local2</option>,
501 <option>local3</option>,
502 <option>local4</option>,
503 <option>local5</option>,
504 <option>local6</option> or
505 <option>local7</option>. See
506 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
507 for details. This option is only
508 useful when
509 <varname>StandardOutput=</varname> or
510 <varname>StandardError=</varname> are
511 set to <option>syslog</option>.
512 Defaults to
513 <option>daemon</option>.</para></listitem>
514 </varlistentry>
515 <varlistentry>
516 <term><varname>SyslogLevel=</varname></term>
517 <listitem><para>Default syslog level
518 to use when logging to syslog or the
519 kernel log buffer. One of
520 <option>emerg</option>,
521 <option>alert</option>,
522 <option>crit</option>,
523 <option>err</option>,
524 <option>warning</option>,
525 <option>notice</option>,
526 <option>info</option>,
527 <option>debug</option>. See
528 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
529 for details. This option is only
530 useful when
531 <varname>StandardOutput=</varname> or
532 <varname>StandardError=</varname> are
533 set to <option>syslog</option> or
534 <option>kmsg</option>. Note that
535 individual lines output by the daemon
536 might be prefixed with a different log
537 level which can be used to override
538 the default log level specified
539 here. The interpretation of these
540 prefixes may be disabled with
541 <varname>SyslogLevelPrefix=</varname>,
542 see below. For details see
543 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
544
545 Defaults to
546 <option>info</option>.</para></listitem>
547 </varlistentry>
548
549 <varlistentry>
550 <term><varname>SyslogLevelPrefix=</varname></term>
551 <listitem><para>Takes a boolean
552 argument. If true and
553 <varname>StandardOutput=</varname> or
554 <varname>StandardError=</varname> are
555 set to <option>syslog</option> or
556 <option>kmsg</option> log lines
557 written by the executed process that
558 are prefixed with a log level will be
559 passed on to syslog with this log
560 level set but the prefix removed. If
561 set to false, the interpretation of
562 these prefixes is disabled and the
563 logged lines are passed on as-is. For
564 details about this prefixing see
565 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
566 Defaults to true.</para></listitem>
567 </varlistentry>
568
569 <varlistentry>
570 <term><varname>TimerSlackNSec=</varname></term>
571 <listitem><para>Sets the timer slack
572 in nanoseconds for the executed
573 processes. The timer slack controls the
574 accuracy of wake-ups triggered by
575 timers. See
576 <citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
577 for more information. Note that in
578 contrast to most other time span
579 definitions this parameter takes an
580 integer value in nano-seconds and does
581 not understand any other
582 units.</para></listitem>
583 </varlistentry>
584
585 <varlistentry>
586 <term><varname>LimitCPU=</varname></term>
587 <term><varname>LimitFSIZE=</varname></term>
588 <term><varname>LimitDATA=</varname></term>
589 <term><varname>LimitSTACK=</varname></term>
590 <term><varname>LimitCORE=</varname></term>
591 <term><varname>LimitRSS=</varname></term>
592 <term><varname>LimitNOFILE=</varname></term>
593 <term><varname>LimitAS=</varname></term>
594 <term><varname>LimitNPROC=</varname></term>
595 <term><varname>LimitMEMLOCK=</varname></term>
596 <term><varname>LimitLOCKS=</varname></term>
597 <term><varname>LimitSIGPENDING=</varname></term>
598 <term><varname>LimitMSGQUEUE=</varname></term>
599 <term><varname>LimitNICE=</varname></term>
600 <term><varname>LimitRTPRIO=</varname></term>
601 <term><varname>LimitRTTIME=</varname></term>
602 <listitem><para>These settings control
603 various resource limits for executed
604 processes. See
605 <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
606 for details. Use the string
607 <varname>infinity</varname> to
608 configure no limit on a specific
609 resource.</para></listitem>
610 </varlistentry>
611
612 <varlistentry>
613 <term><varname>PAMName=</varname></term>
614 <listitem><para>Sets the PAM service
615 name to set up a session as. If set
616 the executed process will be
617 registered as a PAM session under the
618 specified service name. This is only
619 useful in conjunction with the
620 <varname>User=</varname> setting. If
621 not set no PAM session will be opened
622 for the executed processes. See
623 <citerefentry><refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum></citerefentry>
624 for details.</para></listitem>
625 </varlistentry>
626
627 <varlistentry>
628 <term><varname>TCPWrapName=</varname></term>
629 <listitem><para>If this is a
630 socket-activated service this sets the
631 tcpwrap service name to check the
632 permission for the current connection
633 with. This is only useful in
634 conjunction with socket-activated
635 services, and stream sockets (TCP) in
636 particular. It has no effect on other
637 socket types (e.g. datagram/UDP) and on processes
638 unrelated to socket-based
639 activation. If the tcpwrap
640 verification fails daemon start-up
641 will fail and the connection is
642 terminated. See
643 <citerefentry><refentrytitle>tcpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
644 for details.</para></listitem>
645 </varlistentry>
646
647 <varlistentry>
648 <term><varname>CapabilityBoundingSet=</varname></term>
649
650 <listitem><para>Controls which
651 capabilities to include in the
652 capability bounding set for the
653 executed process. See
654 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
655 for details. Takes a whitespace
656 separated list of capability names as
657 read by
658 <citerefentry><refentrytitle>cap_from_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
659 Capabilities listed will be included
660 in the bounding set, all others are
661 removed. If the list of capabilities
662 is prefixed with ~ all but the listed
663 capabilities will be included, the
664 effect of the assignment
665 inverted. Note that this option does
666 not actually set or unset any
667 capabilities in the effective,
668 permitted or inherited capability
669 sets. That's what
670 <varname>Capabilities=</varname> is
671 for. If this option is not used the
672 capability bounding set is not
673 modified on process execution, hence
674 no limits on the capabilities of the
675 process are enforced.</para></listitem>
676 </varlistentry>
677
678 <varlistentry>
679 <term><varname>SecureBits=</varname></term>
680 <listitem><para>Controls the secure
681 bits set for the executed process. See
682 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
683 for details. Takes a list of strings:
684 <option>keep-caps</option>,
685 <option>keep-caps-locked</option>,
686 <option>no-setuid-fixup</option>,
687 <option>no-setuid-fixup-locked</option>,
688 <option>noroot</option> and/or
689 <option>noroot-locked</option>.
690 </para></listitem>
691 </varlistentry>
692
693 <varlistentry>
694 <term><varname>Capabilities=</varname></term>
695 <listitem><para>Controls the
696 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
697 set for the executed process. Take a
698 capability string describing the
699 effective, permitted and inherited
700 capability sets as documented in
701 <citerefentry><refentrytitle>cap_from_text</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
702 Note that these capability sets are
703 usually influenced by the capabilities
704 attached to the executed file. Due to
705 that
706 <varname>CapabilityBoundingSet=</varname>
707 is probably the much more useful
708 setting.</para></listitem>
709 </varlistentry>
710
711 <varlistentry>
712 <term><varname>ControlGroup=</varname></term>
713
714 <listitem><para>Controls the control
715 groups the executed processes shall be
716 made members of. Takes a
717 space-separated list of cgroup
718 identifiers. A cgroup identifier has a
719 format like
720 <filename>cpu:/foo/bar</filename>,
721 where "cpu" identifies the kernel
722 control group controller used, and
723 <filename>/foo/bar</filename> is the
724 control group path. The controller
725 name and ":" may be omitted in which
726 case the named systemd control group
727 hierarchy is implied. Alternatively,
728 the path and ":" may be omitted, in
729 which case the default control group
730 path for this unit is implied. This
731 option may be used to place executed
732 processes in arbitrary groups in
733 arbitrary hierarchies -- which can be
734 configured externally with additional
735 execution limits. By default systemd
736 will place all executed processes in
737 separate per-unit control groups
738 (named after the unit) in the systemd
739 named hierarchy. Since every process
740 can be in one group per hierarchy only
741 overriding the control group path in
742 the named systemd hierarchy will
743 disable automatic placement in the
744 default group. This option is
745 primarily intended to place executed
746 processes in specific paths in
747 specific kernel controller
748 hierarchies. It is however not
749 recommended to manipulate the service
750 control group path in the systemd
751 named hierarchy. For details about
752 control groups see <ulink
753 url="http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>.</para></listitem>
754 </varlistentry>
755
756 <varlistentry>
757 <term><varname>ControlGroupModify=</varname></term>
758 <listitem><para>Takes a boolean
759 argument. If true, the control groups
760 created for this unit will be owned by
761 the user specified with
762 <varname>User=</varname> (and the
763 appropriate group), and he/she can create
764 subgroups as well as add processes to
765 the group.</para></listitem>
766 </varlistentry>
767
768 <varlistentry>
769 <term><varname>ControlGroupAttribute=</varname></term>
770
771 <listitem><para>Set a specific control
772 group attribute for executed
773 processes, and (if needed) add the the
774 executed processes to a cgroup in the
775 hierarchy of the controller the
776 attribute belongs to. Takes two
777 space-separated arguments: the
778 attribute name (syntax is
779 <literal>cpu.shares</literal> where
780 <literal>cpu</literal> refers to a
781 specific controller and
782 <literal>shares</literal> to the
783 attribute name), and the attribute
784 value. Example:
785 <literal>ControlGroupAttribute=cpu.shares
786 512</literal>. If this option is used
787 for an attribute that belongs to a
788 kernel controller hierarchy the unit
789 is not already configured to be added
790 to (for example via the
791 <literal>ControlGroup=</literal>
792 option) then the unit will be added to
793 the controller and the default unit
794 cgroup path is implied. Thus, using
795 <varname>ControlGroupAttribute=</varname>
796 is in most case sufficient to make use
797 of control group enforcements,
798 explicit
799 <varname>ControlGroup=</varname> are
800 only necessary in case the implied
801 default control group path for a
802 service is not desirable. For details
803 about control group attributes see
804 <ulink
805 url="http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>. This
806 option may appear more than once, in
807 order to set multiple control group
808 attributes.</para></listitem>
809 </varlistentry>
810
811 <varlistentry>
812 <term><varname>CPUShares=</varname></term>
813
814 <listitem><para>Assign the specified
815 overall CPU time shares to the
816 processes executed. Takes an integer
817 value. This controls the
818 <literal>cpu.shares</literal> control
819 group attribute, which defaults to
820 1024. For details about this control
821 group attribute see <ulink
822 url="http://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt">sched-design-CFS.txt</ulink>.</para></listitem>
823 </varlistentry>
824
825 <varlistentry>
826 <term><varname>MemoryLimit=</varname></term>
827 <term><varname>MemorySoftLimit=</varname></term>
828
829 <listitem><para>Limit the overall memory usage
830 of the executed processes to a certain
831 size. Takes a memory size in bytes. If
832 the value is suffixed with K, M, G or
833 T the specified memory size is parsed
834 as Kilobytes, Megabytes, Gigabytes,
835 resp. Terabytes (to the base
836 1024). This controls the
837 <literal>memory.limit_in_bytes</literal>
838 and
839 <literal>memory.soft_limit_in_bytes</literal>
840 control group attributes. For details
841 about these control group attributes
842 see <ulink
843 url="http://www.kernel.org/doc/Documentation/cgroups/memory.txt">memory.txt</ulink>.</para></listitem>
844 </varlistentry>
845
846 <varlistentry>
847 <term><varname>DeviceAllow=</varname></term>
848 <term><varname>DeviceDeny=</varname></term>
849
850 <listitem><para>Control access to
851 specific device nodes by the executed processes. Takes two
852 space separated strings: a device node
853 path (such as
854 <filename>/dev/null</filename>)
855 followed by a combination of r, w, m
856 to control reading, writing resp.
857 creating of the specific device node
858 by the unit. This controls the
859 <literal>devices.allow</literal>
860 and
861 <literal>devices.deny</literal>
862 control group attributes. For details
863 about these control group attributes
864 see <ulink
865 url="http://www.kernel.org/doc/Documentation/cgroups/devices.txt">devices.txt</ulink>.</para></listitem>
866 </varlistentry>
867
868 <varlistentry>
869 <term><varname>BlockIOWeight=</varname></term>
870
871 <listitem><para>Set the default or
872 per-device overall block IO weight
873 value for the executed
874 processes. Takes either a single
875 weight value (between 10 and 1000) to
876 set the default block IO weight, or a
877 space separated pair of a file path
878 and a weight value to specify the
879 device specific weight value (Example:
880 "/dev/sda 500"). The file path may be
881 specified as path to a block device
882 node or as any other file in which
883 case the backing block device of the
884 file system of the file is
885 determined. This controls the
886 <literal>blkio.weight</literal> and
887 <literal>blkio.weight_device</literal>
888 control group attributes, which
889 default to 1000. Use this option
890 multiple times to set weights for
891 multiple devices. For details about
892 these control group attributes see
893 <ulink
894 url="http://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt">blkio-controller.txt</ulink>.</para></listitem>
895 </varlistentry>
896
897 <varlistentry>
898 <term><varname>BlockIOReadBandwidth=</varname></term>
899 <term><varname>BlockIOWriteBandwidth=</varname></term>
900
901 <listitem><para>Set the per-device
902 overall block IO bandwith limit for
903 the executed processes. Takes a space
904 separated pair of a file path and a
905 bandwith value (in bytes per second)
906 to specify the device specific
907 bandwidth. The file path may be
908 specified as path to a block device
909 node or as any other file in which
910 case the backing block device of the
911 file system of the file is determined.
912 If the bandwith is suffixed with K, M,
913 G, or T the specified bandwith is
914 parsed as Kilobytes, Megabytes,
915 Gigabytes, resp. Terabytes (Example:
916 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
917 5M"). This controls the
918 <literal>blkio.read_bps_device</literal>
919 and
920 <literal>blkio.write_bps_device</literal>
921 control group attributes. Use this
922 option multiple times to set bandwith
923 limits for multiple devices. For
924 details about these control group
925 attributes see <ulink
926 url="http://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt">blkio-controller.txt</ulink>.</para></listitem>
927 </varlistentry>
928
929 <varlistentry>
930 <term><varname>ReadWriteDirectories=</varname></term>
931 <term><varname>ReadOnlyDirectories=</varname></term>
932 <term><varname>InaccessibleDirectories=</varname></term>
933
934 <listitem><para>Sets up a new
935 file-system name space for executed
936 processes. These options may be used
937 to limit access a process might have
938 to the main file-system
939 hierarchy. Each setting takes a
940 space-separated list of absolute
941 directory paths. Directories listed in
942 <varname>ReadWriteDirectories=</varname>
943 are accessible from within the
944 namespace with the same access rights
945 as from outside. Directories listed in
946 <varname>ReadOnlyDirectories=</varname>
947 are accessible for reading only,
948 writing will be refused even if the
949 usual file access controls would
950 permit this. Directories listed in
951 <varname>InaccessibleDirectories=</varname>
952 will be made inaccessible for processes
953 inside the namespace. Note that
954 restricting access with these options
955 does not extend to submounts of a
956 directory. You must list submounts
957 separately in these settings to
958 ensure the same limited access. These
959 options may be specified more than
960 once in which case all directories
961 listed will have limited access from
962 within the
963 namespace.</para></listitem>
964 </varlistentry>
965
966 <varlistentry>
967 <term><varname>PrivateTmp=</varname></term>
968
969 <listitem><para>Takes a boolean
970 argument. If true sets up a new file
971 system namespace for the executed
972 processes and mounts a private
973 <filename>/tmp</filename> directory
974 inside it, that is not shared by
975 processes outside of the
976 namespace. This is useful to secure
977 access to temporary files of the
978 process, but makes sharing between
979 processes via
980 <filename>/tmp</filename>
981 impossible. Defaults to
982 false.</para></listitem>
983 </varlistentry>
984
985 <varlistentry>
986 <term><varname>PrivateNetwork=</varname></term>
987
988 <listitem><para>Takes a boolean
989 argument. If true sets up a new
990 network namespace for the executed
991 processes and configures only the
992 loopback network device
993 <literal>lo</literal> inside it. No
994 other network devices will be
995 available to the executed process.
996 This is useful to securely turn off
997 network access by the executed
998 process. Defaults to
999 false.</para></listitem>
1000 </varlistentry>
1001
1002 <varlistentry>
1003 <term><varname>MountFlags=</varname></term>
1004
1005 <listitem><para>Takes a mount
1006 propagation flag:
1007 <option>shared</option>,
1008 <option>slave</option> or
1009 <option>private</option>, which
1010 control whether namespaces set up with
1011 <varname>ReadWriteDirectories=</varname>,
1012 <varname>ReadOnlyDirectories=</varname>
1013 and
1014 <varname>InaccessibleDirectories=</varname>
1015 receive or propagate new mounts
1016 from/to the main namespace. See
1017 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1018 for details. Defaults to
1019 <option>shared</option>, i.e. the new
1020 namespace will both receive new mount
1021 points from the main namespace as well
1022 as propagate new mounts to
1023 it.</para></listitem>
1024 </varlistentry>
1025
1026 <varlistentry>
1027 <term><varname>UtmpIdentifier=</varname></term>
1028
1029 <listitem><para>Takes a a four
1030 character identifier string for an
1031 utmp/wtmp entry for this service. This
1032 should only be set for services such
1033 as <command>getty</command>
1034 implementations where utmp/wtmp
1035 entries must be created and cleared
1036 before and after execution. If the
1037 configured string is longer than four
1038 characters it is truncated and the
1039 terminal four characters are
1040 used. This setting interprets %I style
1041 string replacements. This setting is
1042 unset by default, i.e. no utmp/wtmp
1043 entries are created or cleaned up for
1044 this service.</para></listitem>
1045 </varlistentry>
1046
1047 </variablelist>
1048 </refsect1>
1049
1050 <refsect1>
1051 <title>See Also</title>
1052 <para>
1053 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1054 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1055 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1056 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1057 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1058 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1059 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1060 </para>
1061 </refsect1>
1062
1063 </refentry>