]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.exec.xml
relicense to LGPLv2.1 (with exceptions)
[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 Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser 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>journal</option>,
370 <option>syslog+console</option>,
371 <option>kmsg+console</option>,
372 <option>journal+console</option> or
373 <option>socket</option>. If set to
374 <option>inherit</option> the file
375 descriptor of standard input is
376 duplicated for standard output. If set
377 to <option>null</option> standard
378 output will be connected to
379 <filename>/dev/null</filename>,
380 i.e. everything written to it will be
381 lost. If set to <option>tty</option>
382 standard output will be connected to a
383 tty (as configured via
384 <varname>TTYPath=</varname>, see
385 below). If the TTY is used for output
386 only the executed process will not
387 become the controlling process of the
388 terminal, and will not fail or wait
389 for other processes to release the
390 terminal. <option>syslog</option>
391 connects standard output to the
392 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
393 system syslog
394 service. <option>kmsg</option>
395 connects it with the kernel log buffer
396 which is accessible via
397 <citerefentry><refentrytitle>dmesg</refentrytitle><manvolnum>1</manvolnum></citerefentry>. <option>journal</option>
398 connects it with the journal which is
399 accessible via
400 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
401 (Note that everything that is written
402 to syslog or kmsg is implicitly stored
403 in the journal as well, those options
404 are hence supersets of this
405 one). <option>syslog+console</option>,
406 <option>journal+console</option> and
407 <option>kmsg+console</option> work
408 similarly but copy the output to the
409 system console as
410 well. <option>socket</option> connects
411 standard output to a socket from
412 socket activation, semantics are
413 similar to the respective option of
414 <varname>StandardInput=</varname>.
415 This setting defaults to the value set
416 with
417 <option>DefaultStandardOutput=</option>
418 in
419 <citerefentry><refentrytitle>systemd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
420 which defaults to
421 <option>journal</option>.</para></listitem>
422 </varlistentry>
423 <varlistentry>
424 <term><varname>StandardError=</varname></term>
425 <listitem><para>Controls where file
426 descriptor 2 (STDERR) of the executed
427 processes is connected to. The
428 available options are identical to
429 those of
430 <varname>StandardOutput=</varname>,
431 with one exception: if set to
432 <option>inherit</option> the file
433 descriptor used for standard output is
434 duplicated for standard error. This
435 setting defaults to the value set with
436 <option>DefaultStandardError=</option>
437 in
438 <citerefentry><refentrytitle>systemd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
439 which defaults to
440 <option>inherit</option>.</para></listitem>
441 </varlistentry>
442 <varlistentry>
443 <term><varname>TTYPath=</varname></term>
444 <listitem><para>Sets the terminal
445 device node to use if standard input,
446 output or stderr are connected to a
447 TTY (see above). Defaults to
448 <filename>/dev/console</filename>.</para></listitem>
449 </varlistentry>
450 <varlistentry>
451 <term><varname>TTYReset=</varname></term>
452 <listitem><para>Reset the terminal
453 device specified with
454 <varname>TTYPath=</varname> before and
455 after execution. Defaults to
456 <literal>no</literal>.</para></listitem>
457 </varlistentry>
458 <varlistentry>
459 <term><varname>TTYVHangup=</varname></term>
460 <listitem><para>Disconnect all clients
461 which have opened the terminal device
462 specified with
463 <varname>TTYPath=</varname>
464 before and after execution. Defaults
465 to
466 <literal>no</literal>.</para></listitem>
467 </varlistentry>
468 <varlistentry>
469 <term><varname>TTYVTDisallocate=</varname></term>
470 <listitem><para>If the the terminal
471 device specified with
472 <varname>TTYPath=</varname> is a
473 virtual console terminal try to
474 deallocate the TTY before and after
475 execution. This ensures that the
476 screen and scrollback buffer is
477 cleared. Defaults to
478 <literal>no</literal>.</para></listitem>
479 </varlistentry>
480 <varlistentry>
481 <term><varname>SyslogIdentifier=</varname></term>
482 <listitem><para>Sets the process name
483 to prefix log lines sent to syslog or
484 the kernel log buffer with. If not set
485 defaults to the process name of the
486 executed process. This option is only
487 useful when
488 <varname>StandardOutput=</varname> or
489 <varname>StandardError=</varname> are
490 set to <option>syslog</option> or
491 <option>kmsg</option>.</para></listitem>
492 </varlistentry>
493 <varlistentry>
494 <term><varname>SyslogFacility=</varname></term>
495 <listitem><para>Sets the syslog
496 facility to use when logging to
497 syslog. One of <option>kern</option>,
498 <option>user</option>,
499 <option>mail</option>,
500 <option>daemon</option>,
501 <option>auth</option>,
502 <option>syslog</option>,
503 <option>lpr</option>,
504 <option>news</option>,
505 <option>uucp</option>,
506 <option>cron</option>,
507 <option>authpriv</option>,
508 <option>ftp</option>,
509 <option>local0</option>,
510 <option>local1</option>,
511 <option>local2</option>,
512 <option>local3</option>,
513 <option>local4</option>,
514 <option>local5</option>,
515 <option>local6</option> or
516 <option>local7</option>. See
517 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
518 for details. This option is only
519 useful when
520 <varname>StandardOutput=</varname> or
521 <varname>StandardError=</varname> are
522 set to <option>syslog</option>.
523 Defaults to
524 <option>daemon</option>.</para></listitem>
525 </varlistentry>
526 <varlistentry>
527 <term><varname>SyslogLevel=</varname></term>
528 <listitem><para>Default syslog level
529 to use when logging to syslog or the
530 kernel log buffer. One of
531 <option>emerg</option>,
532 <option>alert</option>,
533 <option>crit</option>,
534 <option>err</option>,
535 <option>warning</option>,
536 <option>notice</option>,
537 <option>info</option>,
538 <option>debug</option>. See
539 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
540 for details. This option is only
541 useful when
542 <varname>StandardOutput=</varname> or
543 <varname>StandardError=</varname> are
544 set to <option>syslog</option> or
545 <option>kmsg</option>. Note that
546 individual lines output by the daemon
547 might be prefixed with a different log
548 level which can be used to override
549 the default log level specified
550 here. The interpretation of these
551 prefixes may be disabled with
552 <varname>SyslogLevelPrefix=</varname>,
553 see below. For details see
554 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
555
556 Defaults to
557 <option>info</option>.</para></listitem>
558 </varlistentry>
559
560 <varlistentry>
561 <term><varname>SyslogLevelPrefix=</varname></term>
562 <listitem><para>Takes a boolean
563 argument. If true and
564 <varname>StandardOutput=</varname> or
565 <varname>StandardError=</varname> are
566 set to <option>syslog</option> or
567 <option>kmsg</option> log lines
568 written by the executed process that
569 are prefixed with a log level will be
570 passed on to syslog with this log
571 level set but the prefix removed. If
572 set to false, the interpretation of
573 these prefixes is disabled and the
574 logged lines are passed on as-is. For
575 details about this prefixing see
576 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
577 Defaults to true.</para></listitem>
578 </varlistentry>
579
580 <varlistentry>
581 <term><varname>TimerSlackNSec=</varname></term>
582 <listitem><para>Sets the timer slack
583 in nanoseconds for the executed
584 processes. The timer slack controls the
585 accuracy of wake-ups triggered by
586 timers. See
587 <citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
588 for more information. Note that in
589 contrast to most other time span
590 definitions this parameter takes an
591 integer value in nano-seconds and does
592 not understand any other
593 units.</para></listitem>
594 </varlistentry>
595
596 <varlistentry>
597 <term><varname>LimitCPU=</varname></term>
598 <term><varname>LimitFSIZE=</varname></term>
599 <term><varname>LimitDATA=</varname></term>
600 <term><varname>LimitSTACK=</varname></term>
601 <term><varname>LimitCORE=</varname></term>
602 <term><varname>LimitRSS=</varname></term>
603 <term><varname>LimitNOFILE=</varname></term>
604 <term><varname>LimitAS=</varname></term>
605 <term><varname>LimitNPROC=</varname></term>
606 <term><varname>LimitMEMLOCK=</varname></term>
607 <term><varname>LimitLOCKS=</varname></term>
608 <term><varname>LimitSIGPENDING=</varname></term>
609 <term><varname>LimitMSGQUEUE=</varname></term>
610 <term><varname>LimitNICE=</varname></term>
611 <term><varname>LimitRTPRIO=</varname></term>
612 <term><varname>LimitRTTIME=</varname></term>
613 <listitem><para>These settings control
614 various resource limits for executed
615 processes. See
616 <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>
617 for details. Use the string
618 <varname>infinity</varname> to
619 configure no limit on a specific
620 resource.</para></listitem>
621 </varlistentry>
622
623 <varlistentry>
624 <term><varname>PAMName=</varname></term>
625 <listitem><para>Sets the PAM service
626 name to set up a session as. If set
627 the executed process will be
628 registered as a PAM session under the
629 specified service name. This is only
630 useful in conjunction with the
631 <varname>User=</varname> setting. If
632 not set no PAM session will be opened
633 for the executed processes. See
634 <citerefentry><refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum></citerefentry>
635 for details.</para></listitem>
636 </varlistentry>
637
638 <varlistentry>
639 <term><varname>TCPWrapName=</varname></term>
640 <listitem><para>If this is a
641 socket-activated service this sets the
642 tcpwrap service name to check the
643 permission for the current connection
644 with. This is only useful in
645 conjunction with socket-activated
646 services, and stream sockets (TCP) in
647 particular. It has no effect on other
648 socket types (e.g. datagram/UDP) and
649 on processes unrelated to socket-based
650 activation. If the tcpwrap
651 verification fails daemon start-up
652 will fail and the connection is
653 terminated. See
654 <citerefentry><refentrytitle>tcpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
655 for details. Note that this option may
656 be used to do access control checks
657 only. Shell commands and commands
658 described in
659 <citerefentry><refentrytitle>hosts_options</refentrytitle><manvolnum>5</manvolnum></citerefentry>
660 are not supported.</para></listitem>
661 </varlistentry>
662
663 <varlistentry>
664 <term><varname>CapabilityBoundingSet=</varname></term>
665
666 <listitem><para>Controls which
667 capabilities to include in the
668 capability bounding set for the
669 executed process. See
670 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
671 for details. Takes a whitespace
672 separated list of capability names as
673 read by
674 <citerefentry><refentrytitle>cap_from_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
675 Capabilities listed will be included
676 in the bounding set, all others are
677 removed. If the list of capabilities
678 is prefixed with ~ all but the listed
679 capabilities will be included, the
680 effect of the assignment
681 inverted. Note that this option does
682 not actually set or unset any
683 capabilities in the effective,
684 permitted or inherited capability
685 sets. That's what
686 <varname>Capabilities=</varname> is
687 for. If this option is not used the
688 capability bounding set is not
689 modified on process execution, hence
690 no limits on the capabilities of the
691 process are enforced.</para></listitem>
692 </varlistentry>
693
694 <varlistentry>
695 <term><varname>SecureBits=</varname></term>
696 <listitem><para>Controls the secure
697 bits set for the executed process. See
698 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
699 for details. Takes a list of strings:
700 <option>keep-caps</option>,
701 <option>keep-caps-locked</option>,
702 <option>no-setuid-fixup</option>,
703 <option>no-setuid-fixup-locked</option>,
704 <option>noroot</option> and/or
705 <option>noroot-locked</option>.
706 </para></listitem>
707 </varlistentry>
708
709 <varlistentry>
710 <term><varname>Capabilities=</varname></term>
711 <listitem><para>Controls the
712 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
713 set for the executed process. Take a
714 capability string describing the
715 effective, permitted and inherited
716 capability sets as documented in
717 <citerefentry><refentrytitle>cap_from_text</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
718 Note that these capability sets are
719 usually influenced by the capabilities
720 attached to the executed file. Due to
721 that
722 <varname>CapabilityBoundingSet=</varname>
723 is probably the much more useful
724 setting.</para></listitem>
725 </varlistentry>
726
727 <varlistentry>
728 <term><varname>ControlGroup=</varname></term>
729
730 <listitem><para>Controls the control
731 groups the executed processes shall be
732 made members of. Takes a
733 space-separated list of cgroup
734 identifiers. A cgroup identifier has a
735 format like
736 <filename>cpu:/foo/bar</filename>,
737 where "cpu" identifies the kernel
738 control group controller used, and
739 <filename>/foo/bar</filename> is the
740 control group path. The controller
741 name and ":" may be omitted in which
742 case the named systemd control group
743 hierarchy is implied. Alternatively,
744 the path and ":" may be omitted, in
745 which case the default control group
746 path for this unit is implied. This
747 option may be used to place executed
748 processes in arbitrary groups in
749 arbitrary hierarchies -- which can be
750 configured externally with additional
751 execution limits. By default systemd
752 will place all executed processes in
753 separate per-unit control groups
754 (named after the unit) in the systemd
755 named hierarchy. Since every process
756 can be in one group per hierarchy only
757 overriding the control group path in
758 the named systemd hierarchy will
759 disable automatic placement in the
760 default group. This option is
761 primarily intended to place executed
762 processes in specific paths in
763 specific kernel controller
764 hierarchies. It is however not
765 recommended to manipulate the service
766 control group path in the systemd
767 named hierarchy. For details about
768 control groups see <ulink
769 url="http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>.</para></listitem>
770 </varlistentry>
771
772 <varlistentry>
773 <term><varname>ControlGroupModify=</varname></term>
774 <listitem><para>Takes a boolean
775 argument. If true, the control groups
776 created for this unit will be owned by
777 the user specified with
778 <varname>User=</varname> (and the
779 appropriate group), and he/she can create
780 subgroups as well as add processes to
781 the group.</para></listitem>
782 </varlistentry>
783
784 <varlistentry>
785 <term><varname>ControlGroupPersistent=</varname></term>
786 <listitem><para>Takes a boolean
787 argument. If true, the control groups
788 created for this unit will be marked
789 to be persistent, i.e. systemd will
790 not remove them when stopping the
791 unit. The default is false, meaning
792 that the control groups will be
793 removed when the unit is stopped. For
794 details about the semantics of this
795 logic see <ulink
796 url="http://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups">PaxControlGroups</ulink>.</para></listitem>
797 </varlistentry>
798
799 <varlistentry>
800 <term><varname>ControlGroupAttribute=</varname></term>
801
802 <listitem><para>Set a specific control
803 group attribute for executed
804 processes, and (if needed) add the the
805 executed processes to a cgroup in the
806 hierarchy of the controller the
807 attribute belongs to. Takes two
808 space-separated arguments: the
809 attribute name (syntax is
810 <literal>cpu.shares</literal> where
811 <literal>cpu</literal> refers to a
812 specific controller and
813 <literal>shares</literal> to the
814 attribute name), and the attribute
815 value. Example:
816 <literal>ControlGroupAttribute=cpu.shares
817 512</literal>. If this option is used
818 for an attribute that belongs to a
819 kernel controller hierarchy the unit
820 is not already configured to be added
821 to (for example via the
822 <literal>ControlGroup=</literal>
823 option) then the unit will be added to
824 the controller and the default unit
825 cgroup path is implied. Thus, using
826 <varname>ControlGroupAttribute=</varname>
827 is in most case sufficient to make use
828 of control group enforcements,
829 explicit
830 <varname>ControlGroup=</varname> are
831 only necessary in case the implied
832 default control group path for a
833 service is not desirable. For details
834 about control group attributes see
835 <ulink
836 url="http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt">cgroups.txt</ulink>. This
837 option may appear more than once, in
838 order to set multiple control group
839 attributes.</para></listitem>
840 </varlistentry>
841
842 <varlistentry>
843 <term><varname>CPUShares=</varname></term>
844
845 <listitem><para>Assign the specified
846 overall CPU time shares to the
847 processes executed. Takes an integer
848 value. This controls the
849 <literal>cpu.shares</literal> control
850 group attribute, which defaults to
851 1024. For details about this control
852 group attribute see <ulink
853 url="http://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt">sched-design-CFS.txt</ulink>.</para></listitem>
854 </varlistentry>
855
856 <varlistentry>
857 <term><varname>MemoryLimit=</varname></term>
858 <term><varname>MemorySoftLimit=</varname></term>
859
860 <listitem><para>Limit the overall memory usage
861 of the executed processes to a certain
862 size. Takes a memory size in bytes. If
863 the value is suffixed with K, M, G or
864 T the specified memory size is parsed
865 as Kilobytes, Megabytes, Gigabytes,
866 resp. Terabytes (to the base
867 1024). This controls the
868 <literal>memory.limit_in_bytes</literal>
869 and
870 <literal>memory.soft_limit_in_bytes</literal>
871 control group attributes. For details
872 about these control group attributes
873 see <ulink
874 url="http://www.kernel.org/doc/Documentation/cgroups/memory.txt">memory.txt</ulink>.</para></listitem>
875 </varlistentry>
876
877 <varlistentry>
878 <term><varname>DeviceAllow=</varname></term>
879 <term><varname>DeviceDeny=</varname></term>
880
881 <listitem><para>Control access to
882 specific device nodes by the executed processes. Takes two
883 space separated strings: a device node
884 path (such as
885 <filename>/dev/null</filename>)
886 followed by a combination of r, w, m
887 to control reading, writing resp.
888 creating of the specific device node
889 by the unit. This controls the
890 <literal>devices.allow</literal>
891 and
892 <literal>devices.deny</literal>
893 control group attributes. For details
894 about these control group attributes
895 see <ulink
896 url="http://www.kernel.org/doc/Documentation/cgroups/devices.txt">devices.txt</ulink>.</para></listitem>
897 </varlistentry>
898
899 <varlistentry>
900 <term><varname>BlockIOWeight=</varname></term>
901
902 <listitem><para>Set the default or
903 per-device overall block IO weight
904 value for the executed
905 processes. Takes either a single
906 weight value (between 10 and 1000) to
907 set the default block IO weight, or a
908 space separated pair of a file path
909 and a weight value to specify the
910 device specific weight value (Example:
911 "/dev/sda 500"). The file path may be
912 specified as path to a block device
913 node or as any other file in which
914 case the backing block device of the
915 file system of the file is
916 determined. This controls the
917 <literal>blkio.weight</literal> and
918 <literal>blkio.weight_device</literal>
919 control group attributes, which
920 default to 1000. Use this option
921 multiple times to set weights for
922 multiple devices. For details about
923 these control group attributes see
924 <ulink
925 url="http://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt">blkio-controller.txt</ulink>.</para></listitem>
926 </varlistentry>
927
928 <varlistentry>
929 <term><varname>BlockIOReadBandwidth=</varname></term>
930 <term><varname>BlockIOWriteBandwidth=</varname></term>
931
932 <listitem><para>Set the per-device
933 overall block IO bandwith limit for
934 the executed processes. Takes a space
935 separated pair of a file path and a
936 bandwith value (in bytes per second)
937 to specify the device specific
938 bandwidth. The file path may be
939 specified as path to a block device
940 node or as any other file in which
941 case the backing block device of the
942 file system of the file is determined.
943 If the bandwith is suffixed with K, M,
944 G, or T the specified bandwith is
945 parsed as Kilobytes, Megabytes,
946 Gigabytes, resp. Terabytes (Example:
947 "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
948 5M"). This controls the
949 <literal>blkio.read_bps_device</literal>
950 and
951 <literal>blkio.write_bps_device</literal>
952 control group attributes. Use this
953 option multiple times to set bandwith
954 limits for multiple devices. For
955 details about these control group
956 attributes see <ulink
957 url="http://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt">blkio-controller.txt</ulink>.</para></listitem>
958 </varlistentry>
959
960 <varlistentry>
961 <term><varname>ReadWriteDirectories=</varname></term>
962 <term><varname>ReadOnlyDirectories=</varname></term>
963 <term><varname>InaccessibleDirectories=</varname></term>
964
965 <listitem><para>Sets up a new
966 file-system name space for executed
967 processes. These options may be used
968 to limit access a process might have
969 to the main file-system
970 hierarchy. Each setting takes a
971 space-separated list of absolute
972 directory paths. Directories listed in
973 <varname>ReadWriteDirectories=</varname>
974 are accessible from within the
975 namespace with the same access rights
976 as from outside. Directories listed in
977 <varname>ReadOnlyDirectories=</varname>
978 are accessible for reading only,
979 writing will be refused even if the
980 usual file access controls would
981 permit this. Directories listed in
982 <varname>InaccessibleDirectories=</varname>
983 will be made inaccessible for processes
984 inside the namespace. Note that
985 restricting access with these options
986 does not extend to submounts of a
987 directory. You must list submounts
988 separately in these settings to
989 ensure the same limited access. These
990 options may be specified more than
991 once in which case all directories
992 listed will have limited access from
993 within the
994 namespace.</para></listitem>
995 </varlistentry>
996
997 <varlistentry>
998 <term><varname>PrivateTmp=</varname></term>
999
1000 <listitem><para>Takes a boolean
1001 argument. If true sets up a new file
1002 system namespace for the executed
1003 processes and mounts a private
1004 <filename>/tmp</filename> directory
1005 inside it, that is not shared by
1006 processes outside of the
1007 namespace. This is useful to secure
1008 access to temporary files of the
1009 process, but makes sharing between
1010 processes via
1011 <filename>/tmp</filename>
1012 impossible. Defaults to
1013 false.</para></listitem>
1014 </varlistentry>
1015
1016 <varlistentry>
1017 <term><varname>PrivateNetwork=</varname></term>
1018
1019 <listitem><para>Takes a boolean
1020 argument. If true sets up a new
1021 network namespace for the executed
1022 processes and configures only the
1023 loopback network device
1024 <literal>lo</literal> inside it. No
1025 other network devices will be
1026 available to the executed process.
1027 This is useful to securely turn off
1028 network access by the executed
1029 process. Defaults to
1030 false.</para></listitem>
1031 </varlistentry>
1032
1033 <varlistentry>
1034 <term><varname>MountFlags=</varname></term>
1035
1036 <listitem><para>Takes a mount
1037 propagation flag:
1038 <option>shared</option>,
1039 <option>slave</option> or
1040 <option>private</option>, which
1041 control whether namespaces set up with
1042 <varname>ReadWriteDirectories=</varname>,
1043 <varname>ReadOnlyDirectories=</varname>
1044 and
1045 <varname>InaccessibleDirectories=</varname>
1046 receive or propagate new mounts
1047 from/to the main namespace. See
1048 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1049 for details. Defaults to
1050 <option>shared</option>, i.e. the new
1051 namespace will both receive new mount
1052 points from the main namespace as well
1053 as propagate new mounts to
1054 it.</para></listitem>
1055 </varlistentry>
1056
1057 <varlistentry>
1058 <term><varname>UtmpIdentifier=</varname></term>
1059
1060 <listitem><para>Takes a a four
1061 character identifier string for an
1062 utmp/wtmp entry for this service. This
1063 should only be set for services such
1064 as <command>getty</command>
1065 implementations where utmp/wtmp
1066 entries must be created and cleared
1067 before and after execution. If the
1068 configured string is longer than four
1069 characters it is truncated and the
1070 terminal four characters are
1071 used. This setting interprets %I style
1072 string replacements. This setting is
1073 unset by default, i.e. no utmp/wtmp
1074 entries are created or cleaned up for
1075 this service.</para></listitem>
1076 </varlistentry>
1077
1078 <varlistentry>
1079 <term><varname>IgnoreSIGPIPE=</varname></term>
1080
1081 <listitem><para>Takes a boolean
1082 argument. If true causes SIGPIPE to be
1083 ignored in the executed
1084 process. Defaults to true, since
1085 SIGPIPE generally is useful only in
1086 shell pipelines.</para></listitem>
1087 </varlistentry>
1088
1089 </variablelist>
1090 </refsect1>
1091
1092 <refsect1>
1093 <title>See Also</title>
1094 <para>
1095 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1096 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1097 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1098 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1099 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1100 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1101 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1102 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1103 </para>
1104 </refsect1>
1105
1106 </refentry>