.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Config::Model::models::Systemd::Section::Service 3pm" .TH Config::Model::models::Systemd::Section::Service 3pm "2020-12-20" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Config::Model::models::Systemd::Section::Service \- Configuration class Systemd::Section::Service .SH "DESCRIPTION" .IX Header "DESCRIPTION" Configuration classes used by Config::Model .PP A unit configuration file whose name ends in \&\f(CW\*(C`.service\*(C'\fR encodes information about a process controlled and supervised by systemd. .PP This man page lists the configuration options specific to this unit type. See \&\fBsystemd.unit\fR\|(5) for the common options of all unit configuration files. The common configuration items are configured in the generic [Unit] and [Install] sections. The service specific configuration options are configured in the [Service] section. .PP Additional options are listed in \&\fBsystemd.exec\fR\|(5), which define the execution environment the commands are executed in, and in \&\fBsystemd.kill\fR\|(5), which define the way the processes of the service are terminated, and in \&\fBsystemd.resource\-control\fR\|(5), which configure resource control settings for the processes of the service. .PP If a service is requested under a certain name but no unit configuration file is found, systemd looks for a SysV init script by the same name (with the \f(CW\*(C`.service\*(C'\fR suffix removed) and dynamically creates a service unit from that script. This is useful for compatibility with SysV. Note that this compatibility is quite comprehensive but not 100%. For details about the incompatibilities, see the Incompatibilities with SysV document. .PP The \fBsystemd\-run\fR\|(1) command allows creating \f(CW\*(C`.service\*(C'\fR and \f(CW\*(C`.scope\*(C'\fR units dynamically and transiently from the command line. This configuration class was generated from systemd documentation. by parse\-man.pl .SH "Elements" .IX Header "Elements" .SS "CPUAccounting" .IX Subsection "CPUAccounting" Turn on \s-1CPU\s0 usage accounting for this unit. Takes a boolean argument. Note that turning on \s-1CPU\s0 accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with \&\f(CW\*(C`DefaultCPUAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). \fI Optional. Type boolean. \fR .SS "CPUWeight" .IX Subsection "CPUWeight" Assign the specified \s-1CPU\s0 time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the \f(CW\*(C`cpu.weight\*(C'\fR control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see Control Groups v2 and \s-1CFS\s0 Scheduler . The available \s-1CPU\s0 time is split up among all units within one slice relative to their \s-1CPU\s0 time weight. .PP While \f(CW\*(C`StartupCPUWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`CPUWeight\*(C'\fR applies to normal runtime of the system, and if the former is not set also to the startup phase. Using \f(CW\*(C`StartupCPUWeight\*(C'\fR allows prioritizing specific services at boot-up differently than during normal runtime. .PP These settings replace \f(CW\*(C`CPUShares\*(C'\fR and \f(CW\*(C`StartupCPUShares\*(C'\fR. \fI Optional. Type integer. \fR .IP "upstream_default value :" 4 .IX Item "upstream_default value :" 100 .SS "StartupCPUWeight" .IX Subsection "StartupCPUWeight" Assign the specified \s-1CPU\s0 time weight to the processes executed, if the unified control group hierarchy is used on the system. These options take an integer value and control the \f(CW\*(C`cpu.weight\*(C'\fR control group attribute. The allowed range is 1 to 10000. Defaults to 100. For details about this control group attribute, see Control Groups v2 and \s-1CFS\s0 Scheduler . The available \s-1CPU\s0 time is split up among all units within one slice relative to their \s-1CPU\s0 time weight. .PP While \f(CW\*(C`StartupCPUWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`CPUWeight\*(C'\fR applies to normal runtime of the system, and if the former is not set also to the startup phase. Using \f(CW\*(C`StartupCPUWeight\*(C'\fR allows prioritizing specific services at boot-up differently than during normal runtime. .PP These settings replace \f(CW\*(C`CPUShares\*(C'\fR and \f(CW\*(C`StartupCPUShares\*(C'\fR. \fI Optional. Type integer. \fR .IP "upstream_default value :" 4 .IX Item "upstream_default value :" 100 .SS "CPUQuota" .IX Subsection "CPUQuota" Assign the specified \s-1CPU\s0 time quota to the processes executed. Takes a percentage value, suffixed with \&\*(L"%\*(R". The percentage specifies how much \s-1CPU\s0 time the unit shall get at maximum, relative to the total \s-1CPU\s0 time available on one \s-1CPU.\s0 Use values > 100% for allotting \s-1CPU\s0 time on more than one \s-1CPU.\s0 This controls the \&\f(CW\*(C`cpu.max\*(C'\fR attribute on the unified control group hierarchy and \&\f(CW\*(C`cpu.cfs_quota_us\*(C'\fR on legacy. For details about these control group attributes, see Control Groups v2 and sched\-bwc.txt . .PP Example: \f(CW\*(C`CPUQuota=20%\*(C'\fR ensures that the executed processes will never get more than 20% \s-1CPU\s0 time on one \s-1CPU.\s0 \fI Optional. Type uniline. \fR .SS "CPUQuotaPeriodSec" .IX Subsection "CPUQuotaPeriodSec" Assign the duration over which the \s-1CPU\s0 time quota specified by \f(CW\*(C`CPUQuota\*(C'\fR is measured. Takes a time duration value in seconds, with an optional suffix such as \*(L"ms\*(R" for milliseconds (or \*(L"s\*(R" for seconds.) The default setting is 100ms. The period is clamped to the range supported by the kernel, which is [1ms, 1000ms]. Additionally, the period is adjusted up so that the quota interval is also at least 1ms. Setting \f(CW\*(C`CPUQuotaPeriodSec\*(C'\fR to an empty value resets it to the default. .PP This controls the second field of \f(CW\*(C`cpu.max\*(C'\fR attribute on the unified control group hierarchy and \f(CW\*(C`cpu.cfs_period_us\*(C'\fR on legacy. For details about these control group attributes, see Control Groups v2 and \&\s-1CFS\s0 Scheduler . .PP Example: \f(CW\*(C`CPUQuotaPeriodSec=10ms\*(C'\fR to request that the \s-1CPU\s0 quota is measured in periods of 10ms. \fI Optional. Type uniline. \fR .SS "AllowedCPUs" .IX Subsection "AllowedCPUs" Restrict processes to be executed on specific CPUs. Takes a list of \s-1CPU\s0 indices or ranges separated by either whitespace or commas. \s-1CPU\s0 ranges are specified by the lower and upper \s-1CPU\s0 indices separated by a dash. .PP Setting \f(CW\*(C`AllowedCPUs\*(C'\fR doesn't guarantee that all of the CPUs will be used by the processes as it may be limited by parent units. The effective configuration is reported as \f(CW\*(C`EffectiveCPUs\*(C'\fR. .PP This setting is supported only with the unified control group hierarchy. \fI Optional. Type uniline. \fR .SS "AllowedMemoryNodes" .IX Subsection "AllowedMemoryNodes" Restrict processes to be executed on specific memory \s-1NUMA\s0 nodes. Takes a list of memory \s-1NUMA\s0 nodes indices or ranges separated by either whitespace or commas. Memory \s-1NUMA\s0 nodes ranges are specified by the lower and upper \&\s-1CPU\s0 indices separated by a dash. .PP Setting \f(CW\*(C`AllowedMemoryNodes\*(C'\fR doesn't guarantee that all of the memory \s-1NUMA\s0 nodes will be used by the processes as it may be limited by parent units. The effective configuration is reported as \&\f(CW\*(C`EffectiveMemoryNodes\*(C'\fR. .PP This setting is supported only with the unified control group hierarchy. \fI Optional. Type uniline. \fR .SS "MemoryAccounting" .IX Subsection "MemoryAccounting" Turn on process and kernel memory accounting for this unit. Takes a boolean argument. Note that turning on memory accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with \&\f(CW\*(C`DefaultMemoryAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). \fI Optional. Type boolean. \fR .SS "MemoryMin" .IX Subsection "MemoryMin" Specify the memory usage protection of the executed processes in this unit. When reclaiming memory, the unit is treated as if it was using less memory resulting in memory to be preferentially reclaimed from unprotected units. Using \f(CW\*(C`MemoryLow\*(C'\fR results in a weaker protection where memory may still be reclaimed to avoid invoking the \s-1OOM\s0 killer in case there is no other reclaimable memory. .PP For a protection to be effective, it is generally required to set a corresponding allocation on all ancestors, which is then distributed between children (with the exception of the root slice). Any \f(CW\*(C`MemoryMin\*(C'\fR or \f(CW\*(C`MemoryLow\*(C'\fR allocation that is not explicitly distributed to specific children is used to create a shared protection for all children. As this is a shared protection, the children will freely compete for the memory. .PP Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value \f(CW\*(C`infinity\*(C'\fR, all available memory is protected, which may be useful in order to always inherit all of the protection afforded by ancestors. This controls the \f(CW\*(C`memory.min\*(C'\fR or \f(CW\*(C`memory.low\*(C'\fR control group attribute. For details about this control group attribute, see Memory Interface Files . .PP This setting is supported only if the unified control group hierarchy is used and disables \&\f(CW\*(C`MemoryLimit\*(C'\fR. .PP Units may have their children use a default \f(CW\*(C`memory.min\*(C'\fR or \&\f(CW\*(C`memory.low\*(C'\fR value by specifying \f(CW\*(C`DefaultMemoryMin\*(C'\fR or \&\f(CW\*(C`DefaultMemoryLow\*(C'\fR, which has the same semantics as \&\f(CW\*(C`MemoryMin\*(C'\fR and \f(CW\*(C`MemoryLow\*(C'\fR. This setting does not affect \f(CW\*(C`memory.min\*(C'\fR or \f(CW\*(C`memory.low\*(C'\fR in the unit itself. Using it to set a default child allocation is only useful on kernels older than 5.7, which do not support the \f(CW\*(C`memory_recursiveprot\*(C'\fR cgroup2 mount option. \fI Optional. Type uniline. \fR .SS "MemoryHigh" .IX Subsection "MemoryHigh" Specify the throttling limit on memory usage of the executed processes in this unit. Memory usage may go above the limit if unavoidable, but the processes are heavily slowed down and memory is taken away aggressively in such cases. This is the main mechanism to control memory usage of a unit. .PP Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value \f(CW\*(C`infinity\*(C'\fR, no memory throttling is applied. This controls the \&\f(CW\*(C`memory.high\*(C'\fR control group attribute. For details about this control group attribute, see Memory Interface Files . .PP This setting is supported only if the unified control group hierarchy is used and disables \&\f(CW\*(C`MemoryLimit\*(C'\fR. \fI Optional. Type uniline. \fR .SS "MemoryMax" .IX Subsection "MemoryMax" Specify the absolute limit on memory usage of the executed processes in this unit. If memory usage cannot be contained under the limit, out-of-memory killer is invoked inside the unit. It is recommended to use \f(CW\*(C`MemoryHigh\*(C'\fR as the main control mechanism and use \f(CW\*(C`MemoryMax\*(C'\fR as the last line of defense. .PP Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value \f(CW\*(C`infinity\*(C'\fR, no memory limit is applied. This controls the \&\f(CW\*(C`memory.max\*(C'\fR control group attribute. For details about this control group attribute, see Memory Interface Files . .PP This setting replaces \f(CW\*(C`MemoryLimit\*(C'\fR. \fI Optional. Type uniline. \fR .SS "MemorySwapMax" .IX Subsection "MemorySwapMax" Specify the absolute limit on swap usage of the executed processes in this unit. .PP Takes a swap size in bytes. If the value is suffixed with K, M, G or T, the specified swap size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value \f(CW\*(C`infinity\*(C'\fR, no swap limit is applied. This controls the \&\f(CW\*(C`memory.swap.max\*(C'\fR control group attribute. For details about this control group attribute, see Memory Interface Files . .PP This setting is supported only if the unified control group hierarchy is used and disables \&\f(CW\*(C`MemoryLimit\*(C'\fR. \fI Optional. Type uniline. \fR .SS "TasksAccounting" .IX Subsection "TasksAccounting" Turn on task accounting for this unit. Takes a boolean argument. If enabled, the system manager will keep track of the number of tasks in the unit. The number of tasks accounted this way includes both kernel threads and userspace processes, with each thread counting individually. Note that turning on tasks accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with \&\f(CW\*(C`DefaultTasksAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). \fI Optional. Type boolean. \fR .SS "TasksMax" .IX Subsection "TasksMax" Specify the maximum number of tasks that may be created in the unit. This ensures that the number of tasks accounted for the unit (see above) stays below a specific limit. This either takes an absolute number of tasks or a percentage value that is taken relative to the configured maximum number of tasks on the system. If assigned the special value \f(CW\*(C`infinity\*(C'\fR, no tasks limit is applied. This controls the \f(CW\*(C`pids.max\*(C'\fR control group attribute. For details about this control group attribute, see Process Number Controller . .PP The system default for this setting may be controlled with \&\f(CW\*(C`DefaultTasksMax\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). \fI Optional. Type uniline. \fR .SS "IOAccounting" .IX Subsection "IOAccounting" Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with \f(CW\*(C`DefaultIOAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). .PP This setting replaces \f(CW\*(C`BlockIOAccounting\*(C'\fR and disables settings prefixed with \&\f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. \fI Optional. Type boolean. \fR .SS "IOWeight" .IX Subsection "IOWeight" Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the \f(CW\*(C`io.weight\*(C'\fR control group attribute, which defaults to 100. For details about this control group attribute, see \s-1IO\s0 Interface Files . The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. .PP While \f(CW\*(C`StartupIOWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`IOWeight\*(C'\fR applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. .PP These settings replace \f(CW\*(C`BlockIOWeight\*(C'\fR and \f(CW\*(C`StartupBlockIOWeight\*(C'\fR and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. \fI Optional. Type uniline. \fR .SS "StartupIOWeight" .IX Subsection "StartupIOWeight" Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the \f(CW\*(C`io.weight\*(C'\fR control group attribute, which defaults to 100. For details about this control group attribute, see \s-1IO\s0 Interface Files . The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. .PP While \f(CW\*(C`StartupIOWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`IOWeight\*(C'\fR applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. .PP These settings replace \f(CW\*(C`BlockIOWeight\*(C'\fR and \f(CW\*(C`StartupBlockIOWeight\*(C'\fR and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. \fI Optional. Type uniline. \fR .SS "IODeviceWeight" .IX Subsection "IODeviceWeight" Set the per-device overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 1 and 10000. (Example: \f(CW\*(C`/dev/sda 1000\*(C'\fR). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the \f(CW\*(C`io.weight\*(C'\fR control group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP This setting replaces \f(CW\*(C`BlockIODeviceWeight\*(C'\fR and disables settings prefixed with \&\f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. .PP The specified device node should reference a block device that has an I/O scheduler associated, i.e. should not refer to partition or loopback block devices, but to the originating, physical device. When a path to a regular file or directory is specified it is attempted to discover the correct originating device backing the file system of the specified path. This works correctly only for simpler cases, where the file system is directly placed on a partition or physical block device, or where simple 1:1 encryption using dm\-crypt/LUKS is used. This discovery does not cover complex storage and in particular \s-1RAID\s0 and volume management storage devices. \fI Optional. Type uniline. \fR .SS "IOReadBandwidthMax" .IX Subsection "IOReadBandwidthMax" Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 5M\*(R"). This controls the \f(CW\*(C`io.max\*(C'\fR control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP These settings replace \f(CW\*(C`BlockIOReadBandwidth\*(C'\fR and \&\f(CW\*(C`BlockIOWriteBandwidth\*(C'\fR and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \&\f(CW\*(C`StartupBlockIO\*(C'\fR. .PP Similar restrictions on block device discovery as for \f(CW\*(C`IODeviceWeight\*(C'\fR apply, see above. \fI Optional. Type uniline. \fR .SS "IOWriteBandwidthMax" .IX Subsection "IOWriteBandwidthMax" Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 5M\*(R"). This controls the \f(CW\*(C`io.max\*(C'\fR control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP These settings replace \f(CW\*(C`BlockIOReadBandwidth\*(C'\fR and \&\f(CW\*(C`BlockIOWriteBandwidth\*(C'\fR and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \&\f(CW\*(C`StartupBlockIO\*(C'\fR. .PP Similar restrictions on block device discovery as for \f(CW\*(C`IODeviceWeight\*(C'\fR apply, see above. \fI Optional. Type uniline. \fR .SS "IOReadIOPSMax" .IX Subsection "IOReadIOPSMax" Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an \s-1IOPS\s0 value to specify the device specific \s-1IOPS.\s0 The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the \s-1IOPS\s0 is suffixed with K, M, G, or T, the specified \s-1IOPS\s0 is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 1K\*(R"). This controls the \f(CW\*(C`io.max\*(C'\fR control group attributes. Use this option multiple times to set \s-1IOPS\s0 limits for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. .PP Similar restrictions on block device discovery as for \f(CW\*(C`IODeviceWeight\*(C'\fR apply, see above. \fI Optional. Type uniline. \fR .SS "IOWriteIOPSMax" .IX Subsection "IOWriteIOPSMax" Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an \s-1IOPS\s0 value to specify the device specific \s-1IOPS.\s0 The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the \s-1IOPS\s0 is suffixed with K, M, G, or T, the specified \s-1IOPS\s0 is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 1K\*(R"). This controls the \f(CW\*(C`io.max\*(C'\fR control group attributes. Use this option multiple times to set \s-1IOPS\s0 limits for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP These settings are supported only if the unified control group hierarchy is used and disable settings prefixed with \f(CW\*(C`BlockIO\*(C'\fR or \f(CW\*(C`StartupBlockIO\*(C'\fR. .PP Similar restrictions on block device discovery as for \f(CW\*(C`IODeviceWeight\*(C'\fR apply, see above. \fI Optional. Type uniline. \fR .SS "IODeviceLatencyTargetSec" .IX Subsection "IODeviceLatencyTargetSec" Set the per-device average target I/O latency for the executed processes, if the unified control group hierarchy is used on the system. Takes a file path and a timespan separated by a space to specify the device specific latency target. (Example: \*(L"/dev/sda 25ms\*(R"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the \f(CW\*(C`io.latency\*(C'\fR control group attribute. Use this option multiple times to set latency target for multiple devices. For details about this control group attribute, see \s-1IO\s0 Interface Files . .PP Implies \f(CW\*(C`IOAccounting=yes\*(C'\fR. .PP These settings are supported only if the unified control group hierarchy is used. .PP Similar restrictions on block device discovery as for \f(CW\*(C`IODeviceWeight\*(C'\fR apply, see above. \fI Optional. Type uniline. \fR .SS "IPAccounting" .IX Subsection "IPAccounting" Takes a boolean argument. If true, turns on IPv4 and IPv6 network traffic accounting for packets sent or received by the unit. When this option is turned on, all IPv4 and IPv6 sockets created by any process of the unit are accounted for. .PP When this option is used in socket units, it applies to all IPv4 and IPv6 sockets associated with it (including both listening and connection sockets where this applies). Note that for socket-activated services, this configuration setting and the accounting data of the service unit and the socket unit are kept separate, and displayed separately. No propagation of the setting and the collected statistics is done, in either direction. Moreover, any traffic sent or received on any of the socket unit's sockets is accounted to the socket unit X and never to the service unit it might have activated, even if the socket is used by it. .PP The system default for this setting may be controlled with \f(CW\*(C`DefaultIPAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). \fI Optional. Type boolean. \fR .SS "IPAddressAllow" .IX Subsection "IPAddressAllow" Turn on network traffic filtering for \s-1IP\s0 packets sent and received over \&\f(CW\*(C`AF_INET\*(C'\fR and \f(CW\*(C`AF_INET6\*(C'\fR sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits after a \f(CW\*(C`/\*(C'\fR character. If the suffix is omitted, the address is considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits for IPv6). .PP The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default both access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source \s-1IP\s0 address is checked against these access lists, in case of egress traffic the destination \s-1IP\s0 address is checked. The following rules are applied in turn: .PP In order to implement an allow-listing \s-1IP\s0 firewall, it is recommended to use a \&\f(CW\*(C`IPAddressDeny\*(C'\fR\f(CW\*(C`any\*(C'\fR setting on an upper-level slice unit (such as the root slice \f(CW\*(C`\-.slice\*(C'\fR or the slice containing all system services \&\f(CW\*(C`system.slice\*(C'\fR X see \&\fBsystemd.special\fR\|(7) for details on these slice units), plus individual per-service \f(CW\*(C`IPAddressAllow\*(C'\fR lines permitting network access to relevant services, and only them. .PP Note that for socket-activated services, the \s-1IP\s0 access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the \s-1IP\s0 access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea to replicate the \s-1IP\s0 access lists on both the socket and the service unit. Nevertheless, it may make sense to maintain one list more open and the other one more restricted, depending on the usecase. .PP If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. .PP In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: .PP Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for \s-1IP\s0 security. \fI Optional. Type uniline. \fR .SS "IPAddressDeny" .IX Subsection "IPAddressDeny" Turn on network traffic filtering for \s-1IP\s0 packets sent and received over \&\f(CW\*(C`AF_INET\*(C'\fR and \f(CW\*(C`AF_INET6\*(C'\fR sockets. Both directives take a space separated list of IPv4 or IPv6 addresses, each optionally suffixed with an address prefix length in bits after a \f(CW\*(C`/\*(C'\fR character. If the suffix is omitted, the address is considered a host address, i.e. the filter covers the whole address (32 bits for IPv4, 128 bits for IPv6). .PP The access lists configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The lists are implicitly combined with any lists configured for any of the parent slice units this unit might be a member of. By default both access lists are empty. Both ingress and egress traffic is filtered by these settings. In case of ingress traffic the source \s-1IP\s0 address is checked against these access lists, in case of egress traffic the destination \s-1IP\s0 address is checked. The following rules are applied in turn: .PP In order to implement an allow-listing \s-1IP\s0 firewall, it is recommended to use a \&\f(CW\*(C`IPAddressDeny\*(C'\fR\f(CW\*(C`any\*(C'\fR setting on an upper-level slice unit (such as the root slice \f(CW\*(C`\-.slice\*(C'\fR or the slice containing all system services \&\f(CW\*(C`system.slice\*(C'\fR X see \&\fBsystemd.special\fR\|(7) for details on these slice units), plus individual per-service \f(CW\*(C`IPAddressAllow\*(C'\fR lines permitting network access to relevant services, and only them. .PP Note that for socket-activated services, the \s-1IP\s0 access list configured on the socket unit applies to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the \s-1IP\s0 access list configured for the service is not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea to replicate the \s-1IP\s0 access lists on both the socket and the service unit. Nevertheless, it may make sense to maintain one list more open and the other one more restricted, depending on the usecase. .PP If these settings are used multiple times in the same unit the specified lists are combined. If an empty string is assigned to these settings the specific access list is reset and all previous settings undone. .PP In place of explicit IPv4 or IPv6 address and prefix length specifications a small set of symbolic names may be used. The following names are defined: .PP Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will have no effect in that case. If compatibility with such systems is desired it is hence recommended to not exclusively rely on them for \s-1IP\s0 security. \fI Optional. Type uniline. \fR .SS "IPIngressFilterPath" .IX Subsection "IPIngressFilterPath" Add custom network traffic filters implemented as \s-1BPF\s0 programs, applying to all \s-1IP\s0 packets sent and received over \f(CW\*(C`AF_INET\*(C'\fR and \f(CW\*(C`AF_INET6\*(C'\fR sockets. Takes an absolute path to a pinned \s-1BPF\s0 program in the \s-1BPF\s0 virtual filesystem (\f(CW\*(C`/sys/fs/bpf/\*(C'\fR). .PP The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any \&\f(CW\*(C`IPAddressAllow\*(C'\fR and \f(CW\*(C`IPAddressDeny\*(C'\fR filters in any of these units. By default there are no filters specified. .PP If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. .PP Note that for socket-activated services, the \s-1IP\s0 filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the \s-1IP\s0 filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the \s-1IP\s0 filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. .PP Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires \f(CW\*(C`Delegate\*(C'\fR\f(CW\*(C`yes\*(C'\fR) instead of using this setting. \fI Optional. Type uniline. \fR .SS "IPEgressFilterPath" .IX Subsection "IPEgressFilterPath" Add custom network traffic filters implemented as \s-1BPF\s0 programs, applying to all \s-1IP\s0 packets sent and received over \f(CW\*(C`AF_INET\*(C'\fR and \f(CW\*(C`AF_INET6\*(C'\fR sockets. Takes an absolute path to a pinned \s-1BPF\s0 program in the \s-1BPF\s0 virtual filesystem (\f(CW\*(C`/sys/fs/bpf/\*(C'\fR). .PP The filters configured with this option are applied to all sockets created by processes of this unit (or in the case of socket units, associated with it). The filters are loaded in addition to filters any of the parent slice units this unit might be a member of as well as any \&\f(CW\*(C`IPAddressAllow\*(C'\fR and \f(CW\*(C`IPAddressDeny\*(C'\fR filters in any of these units. By default there are no filters specified. .PP If these settings are used multiple times in the same unit all the specified programs are attached. If an empty string is assigned to these settings the program list is reset and all previous specified programs ignored. .PP Note that for socket-activated services, the \s-1IP\s0 filter programs configured on the socket unit apply to all sockets associated with it directly, but not to any sockets created by the ultimately activated services for it. Conversely, the \s-1IP\s0 filter programs configured for the service are not applied to any sockets passed into the service via socket activation. Thus, it is usually a good idea, to replicate the \s-1IP\s0 filter programs on both the socket and the service unit, however it often makes sense to maintain one configuration more open and the other one more restricted, depending on the usecase. .PP Note that these settings might not be supported on some systems (for example if eBPF control group support is not enabled in the underlying kernel or container manager). These settings will fail the service in that case. If compatibility with such systems is desired it is hence recommended to attach your filter manually (requires \f(CW\*(C`Delegate\*(C'\fR\f(CW\*(C`yes\*(C'\fR) instead of using this setting. \fI Optional. Type uniline. \fR .SS "DeviceAllow" .IX Subsection "DeviceAllow" Control access to specific device nodes by the executed processes. Takes two space-separated strings: a device node specifier followed by a combination of \f(CW\*(C`r\*(C'\fR, \&\f(CW\*(C`w\*(C'\fR, \f(CW\*(C`m\*(C'\fR to control reading, writing, or creation of the specific device node(s) by the unit (mknod), respectively. On cgroup\-v1 this controls the \&\f(CW\*(C`devices.allow\*(C'\fR control group attribute. For details about this control group attribute, see Device Whitelist Controller . In the unified cgroup hierarchy this functionality is implemented using eBPF filtering. .PP The device node specifier is either a path to a device node in the file system, starting with \&\f(CW\*(C`/dev/\*(C'\fR, or a string starting with either \f(CW\*(C`char\-\*(C'\fR or \&\f(CW\*(C`block\-\*(C'\fR followed by a device group name, as listed in \&\f(CW\*(C`/proc/devices\*(C'\fR. The latter is useful to allow-list all current and future devices belonging to a specific device group at once. The device group is matched according to filename globbing rules, you may hence use the \f(CW\*(C`*\*(C'\fR and \f(CW\*(C`?\*(C'\fR wildcards. (Note that such globbing wildcards are not available for device node path specifications!) In order to match device nodes by numeric major/minor, use device node paths in the \f(CW\*(C`/dev/char/\*(C'\fR and \f(CW\*(C`/dev/block/\*(C'\fR directories. However, matching devices by major/minor is generally not recommended as assignments are neither stable nor portable between systems or different kernel versions. .PP Examples: \f(CW\*(C`/dev/sda5\*(C'\fR is a path to a device node, referring to an \s-1ATA\s0 or \&\s-1SCSI\s0 block device. \f(CW\*(C`char\-pts\*(C'\fR and \f(CW\*(C`char\-alsa\*(C'\fR are specifiers for all pseudo TTYs and all \s-1ALSA\s0 sound devices, respectively. \f(CW\*(C`char\-cpu/*\*(C'\fR is a specifier matching all \s-1CPU\s0 related device groups. .PP Note that allow lists defined this way should only reference device groups which are resolvable at the time the unit is started. Any device groups not resolvable then are not added to the device allow list. In order to work around this limitation, consider extending service units with a pair of After=modprobe@xyz.service and Wants=modprobe@xyz.service lines that load the necessary kernel module implementing the device group if missing. Example: X [Unit] Wants=modprobe@loop.service After=modprobe@loop.service [Service] DeviceAllow=block\-loop DeviceAllow=/dev/loop\-control X \&\fI Optional. Type list of uniline. \fR .SS "DevicePolicy" .IX Subsection "DevicePolicy" Control the policy for allowing device access: \&\fI Optional. Type enum. choice: 'auto', 'closed', 'strict'. \fR .SS "Slice" .IX Subsection "Slice" The name of the slice unit to place the unit in. Defaults to \f(CW\*(C`system.slice\*(C'\fR for all non-instantiated units of all unit types (except for slice units themselves see below). Instance units are by default placed in a subslice of \f(CW\*(C`system.slice\*(C'\fR that is named after the template name. .PP This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied. .PP For units of type slice, the only accepted value for this setting is the parent slice. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units. .PP Special care should be taken when relying on the default slice assignment in templated service units that have \f(CW\*(C`DefaultDependencies=no\*(C'\fR set, see \&\fBsystemd.service\fR\|(5), section \&\*(L"Default Dependencies\*(R" for details. \fI Optional. Type uniline. \fR .SS "Delegate" .IX Subsection "Delegate" Turns on delegation of further resource control partitioning to processes of the unit. Units where this is enabled may create and manage their own private subhierarchy of control groups below the control group of the unit itself. For unprivileged services (i.e. those using the \f(CW\*(C`User\*(C'\fR setting) the unit's control group will be made accessible to the relevant user. When enabled the service manager will refrain from manipulating control groups or moving processes below the unit's control group, so that a clear concept of ownership is established: the control group tree above the unit's control group (i.e. towards the root control group) is owned and managed by the service manager of the host, while the control group tree below the unit's control group is owned and managed by the unit itself. Takes either a boolean argument or a list of control group controller names. If true, delegation is turned on, and all supported controllers are enabled for the unit, making them available to the unit's processes for management. If false, delegation is turned off entirely (and no additional controllers are enabled). If set to a list of controllers, delegation is turned on, and the specified controllers are enabled for the unit. Note that additional controllers than the ones specified might be made available as well, depending on configuration of the containing slice unit or other units contained in it. Note that assigning the empty string will enable delegation, but reset the list of controllers, all assignments prior to this will have no effect. Defaults to false. .PP Note that controller delegation to less privileged code is only safe on the unified control group hierarchy. Accordingly, access to the specified controllers will not be granted to unprivileged services on the legacy hierarchy, even when requested. .PP Not all of these controllers are available on all kernels however, and some are specific to the unified hierarchy while others are specific to the legacy hierarchy. Also note that the kernel might support further controllers, which aren't covered here yet as delegation is either not supported at all for them or not defined cleanly. .PP For further details on the delegation model consult Control Group APIs and Delegation . \fI Optional. Type uniline. \fR .SS "DisableControllers" .IX Subsection "DisableControllers" Disables controllers from being enabled for a unit's children. If a controller listed is already in use in its subtree, the controller will be removed from the subtree. This can be used to avoid child units being able to implicitly or explicitly enable a controller. Defaults to not disabling any controllers. .PP It may not be possible to successfully disable a controller if the unit or any child of the unit in question delegates controllers to its children, as any delegated subtree of the cgroup hierarchy is unmanaged by systemd. .PP Multiple controllers may be specified, separated by spaces. You may also pass \&\f(CW\*(C`DisableControllers\*(C'\fR multiple times, in which case each new instance adds another controller to disable. Passing \f(CW\*(C`DisableControllers\*(C'\fR by itself with no controller name present resets the disabled controller list. \fI Optional. Type uniline. \fR .SS "ManagedOOMSwap" .IX Subsection "ManagedOOMSwap" Specifies how \&\fBsystemd\-oomd.service\fR\|(8) will act on this unit's cgroups. Defaults to \f(CW\*(C`auto\*(C'\fR. .PP When set to \f(CW\*(C`kill\*(C'\fR, systemd-oomd will actively monitor this unit's cgroup metrics to decide whether it needs to act. If the cgroup passes the limits set by \&\fBoomd.conf\fR\|(5) or its overrides, systemd-oomd will send a \f(CW\*(C`SIGKILL\*(C'\fR to all of the processes under the chosen candidate cgroup. Note that only descendant cgroups can be eligible candidates for killing; the unit that set its property to \f(CW\*(C`kill\*(C'\fR is not a candidate (unless one of its ancestors set their property to \f(CW\*(C`kill\*(C'\fR). You can find more details on candidates and kill behavior at \&\fBsystemd\-oomd.service\fR\|(8) and \fBoomd.conf\fR\|(5). Setting either of these properties to \f(CW\*(C`kill\*(C'\fR will also automatically acquire \&\f(CW\*(C`After\*(C'\fR and \f(CW\*(C`Wants\*(C'\fR dependencies on \&\f(CW\*(C`systemd\-oomd.service\*(C'\fR unless \f(CW\*(C`DefaultDependencies=no\*(C'\fR. .PP When set to \f(CW\*(C`auto\*(C'\fR, systemd-oomd will not actively use this cgroup's data for monitoring and detection. However, if an ancestor cgroup has one of these properties set to \&\f(CW\*(C`kill\*(C'\fR, a unit with \f(CW\*(C`auto\*(C'\fR can still be an eligible candidate for systemd-oomd to act on. \fI Optional. Type enum. choice: 'auto', 'kill'. \fR .SS "ManagedOOMMemoryPressure" .IX Subsection "ManagedOOMMemoryPressure" Specifies how \&\fBsystemd\-oomd.service\fR\|(8) will act on this unit's cgroups. Defaults to \f(CW\*(C`auto\*(C'\fR. .PP When set to \f(CW\*(C`kill\*(C'\fR, systemd-oomd will actively monitor this unit's cgroup metrics to decide whether it needs to act. If the cgroup passes the limits set by \&\fBoomd.conf\fR\|(5) or its overrides, systemd-oomd will send a \f(CW\*(C`SIGKILL\*(C'\fR to all of the processes under the chosen candidate cgroup. Note that only descendant cgroups can be eligible candidates for killing; the unit that set its property to \f(CW\*(C`kill\*(C'\fR is not a candidate (unless one of its ancestors set their property to \f(CW\*(C`kill\*(C'\fR). You can find more details on candidates and kill behavior at \&\fBsystemd\-oomd.service\fR\|(8) and \fBoomd.conf\fR\|(5). Setting either of these properties to \f(CW\*(C`kill\*(C'\fR will also automatically acquire \&\f(CW\*(C`After\*(C'\fR and \f(CW\*(C`Wants\*(C'\fR dependencies on \&\f(CW\*(C`systemd\-oomd.service\*(C'\fR unless \f(CW\*(C`DefaultDependencies=no\*(C'\fR. .PP When set to \f(CW\*(C`auto\*(C'\fR, systemd-oomd will not actively use this cgroup's data for monitoring and detection. However, if an ancestor cgroup has one of these properties set to \&\f(CW\*(C`kill\*(C'\fR, a unit with \f(CW\*(C`auto\*(C'\fR can still be an eligible candidate for systemd-oomd to act on. \fI Optional. Type enum. choice: 'auto', 'kill'. \fR .SS "ManagedOOMMemoryPressureLimitPercent" .IX Subsection "ManagedOOMMemoryPressureLimitPercent" Overrides the default memory pressure limit set by \&\fBoomd.conf\fR\|(5) for this unit (cgroup). Takes a percentage value between 0% and 100%, inclusive. This property is ignored unless \&\f(CW\*(C`ManagedOOMMemoryPressure\*(C'\fR\f(CW\*(C`kill\*(C'\fR. Defaults to 0%, which means use the default set by \fBoomd.conf\fR\|(5). \&\fI Optional. Type uniline. \fR .SS "CPUShares" .IX Subsection "CPUShares" Assign the specified \s-1CPU\s0 time share weight to the processes executed. These options take an integer value and control the \f(CW\*(C`cpu.shares\*(C'\fR control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see \s-1CFS\s0 Scheduler . The available \s-1CPU\s0 time is split up among all units within one slice relative to their \s-1CPU\s0 time share weight. .PP While \f(CW\*(C`StartupCPUShares\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`CPUShares\*(C'\fR applies to normal runtime of the system, and if the former is not set also to the startup phase. Using \f(CW\*(C`StartupCPUShares\*(C'\fR allows prioritizing specific services at boot-up differently than during normal runtime. .PP Implies \f(CW\*(C`CPUAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`CPUWeight\*(C'\fR and \&\f(CW\*(C`StartupCPUWeight\*(C'\fR instead. \fI Optional. Type integer. \fR .IP "upstream_default value :" 4 .IX Item "upstream_default value :" 1024 .SS "StartupCPUShares" .IX Subsection "StartupCPUShares" Assign the specified \s-1CPU\s0 time share weight to the processes executed. These options take an integer value and control the \f(CW\*(C`cpu.shares\*(C'\fR control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see \s-1CFS\s0 Scheduler . The available \s-1CPU\s0 time is split up among all units within one slice relative to their \s-1CPU\s0 time share weight. .PP While \f(CW\*(C`StartupCPUShares\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`CPUShares\*(C'\fR applies to normal runtime of the system, and if the former is not set also to the startup phase. Using \f(CW\*(C`StartupCPUShares\*(C'\fR allows prioritizing specific services at boot-up differently than during normal runtime. .PP Implies \f(CW\*(C`CPUAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`CPUWeight\*(C'\fR and \&\f(CW\*(C`StartupCPUWeight\*(C'\fR instead. \fI Optional. Type integer. \fR .IP "upstream_default value :" 4 .IX Item "upstream_default value :" 1024 .SS "MemoryLimit" .IX Subsection "MemoryLimit" Specify the limit on maximum memory usage of the executed processes. The limit specifies how much process and kernel memory can be used by tasks in this unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. Alternatively, a percentage value may be specified, which is taken relative to the installed physical memory on the system. If assigned the special value \&\f(CW\*(C`infinity\*(C'\fR, no memory limit is applied. This controls the \&\f(CW\*(C`memory.limit_in_bytes\*(C'\fR control group attribute. For details about this control group attribute, see Memory Resource Controller . .PP Implies \f(CW\*(C`MemoryAccounting=yes\*(C'\fR. .PP This setting is deprecated. Use \f(CW\*(C`MemoryMax\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "BlockIOAccounting" .IX Subsection "BlockIOAccounting" Turn on Block I/O accounting for this unit, if the legacy control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled with \&\f(CW\*(C`DefaultBlockIOAccounting\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5). .PP This setting is deprecated. Use \f(CW\*(C`IOAccounting\*(C'\fR instead. \fI Optional. Type boolean. \fR .SS "BlockIOWeight" .IX Subsection "BlockIOWeight" Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the \f(CW\*(C`blkio.weight\*(C'\fR control group attribute, which defaults to 500. For details about this control group attribute, see Block \s-1IO\s0 Controller . The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. .PP While \f(CW\*(C`StartupBlockIOWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`BlockIOWeight\*(C'\fR applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. .PP Implies \&\f(CW\*(C`BlockIOAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`IOWeight\*(C'\fR and \f(CW\*(C`StartupIOWeight\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "StartupBlockIOWeight" .IX Subsection "StartupBlockIOWeight" Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the \f(CW\*(C`blkio.weight\*(C'\fR control group attribute, which defaults to 500. For details about this control group attribute, see Block \s-1IO\s0 Controller . The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight. .PP While \f(CW\*(C`StartupBlockIOWeight\*(C'\fR only applies to the startup phase of the system, \&\f(CW\*(C`BlockIOWeight\*(C'\fR applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime. .PP Implies \&\f(CW\*(C`BlockIOAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`IOWeight\*(C'\fR and \f(CW\*(C`StartupIOWeight\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "BlockIODeviceWeight" .IX Subsection "BlockIODeviceWeight" Set the per-device overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 10 and 1000. (Example: \*(L"/dev/sda 500\*(R"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the \f(CW\*(C`blkio.weight_device\*(C'\fR control group attribute, which defaults to 1000. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see Block \s-1IO\s0 Controller . .PP Implies \&\f(CW\*(C`BlockIOAccounting=yes\*(C'\fR. .PP This setting is deprecated. Use \f(CW\*(C`IODeviceWeight\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "BlockIOReadBandwidth" .IX Subsection "BlockIOReadBandwidth" Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 5M\*(R"). This controls the \&\f(CW\*(C`blkio.throttle.read_bps_device\*(C'\fR and \f(CW\*(C`blkio.throttle.write_bps_device\*(C'\fR control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see Block \s-1IO\s0 Controller . .PP Implies \&\f(CW\*(C`BlockIOAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`IOReadBandwidthMax\*(C'\fR and \&\f(CW\*(C`IOWriteBandwidthMax\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "BlockIOWriteBandwidth" .IX Subsection "BlockIOWriteBandwidth" Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: \&\*(L"/dev/disk/by\-path/pci\-0000:00:1f.2\-scsi\-0:0:0:0 5M\*(R"). This controls the \&\f(CW\*(C`blkio.throttle.read_bps_device\*(C'\fR and \f(CW\*(C`blkio.throttle.write_bps_device\*(C'\fR control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see Block \s-1IO\s0 Controller . .PP Implies \&\f(CW\*(C`BlockIOAccounting=yes\*(C'\fR. .PP These settings are deprecated. Use \f(CW\*(C`IOReadBandwidthMax\*(C'\fR and \&\f(CW\*(C`IOWriteBandwidthMax\*(C'\fR instead. \fI Optional. Type uniline. \fR .SS "WorkingDirectory" .IX Subsection "WorkingDirectory" Takes a directory path relative to the service's root directory specified by \&\f(CW\*(C`RootDirectory\*(C'\fR, or the special value \f(CW\*(C`~\*(C'\fR. Sets the working directory for executed processes. If set to \f(CW\*(C`~\*(C'\fR, the home directory of the user specified in \&\f(CW\*(C`User\*(C'\fR is used. If not set, defaults to the root directory when systemd is running as a system instance and the respective user's home directory if run as user. If the setting is prefixed with the \&\f(CW\*(C`\-\*(C'\fR character, a missing working directory is not considered fatal. If \&\f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR is not set, then \&\f(CW\*(C`WorkingDirectory\*(C'\fR is relative to the root of the system running the service manager. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). \fI Optional. Type uniline. \fR .SS "RootDirectory" .IX Subsection "RootDirectory" Takes a directory path relative to the host's root directory (i.e. the root of the system running the service manager). Sets the root directory for executed processes, with the \fBchroot\fR\|(2) system call. If this is used, it must be ensured that the process binary and all its auxiliary files are available in the \fBchroot()\fR jail. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). .PP The \f(CW\*(C`MountAPIVFS\*(C'\fR and \f(CW\*(C`PrivateUsers\*(C'\fR settings are particularly useful in conjunction with \f(CW\*(C`RootDirectory\*(C'\fR. For details, see below. \fI Optional. Type uniline. \fR .SS "RootImage" .IX Subsection "RootImage" Takes a path to a block device node or regular file as argument. This call is similar to \f(CW\*(C`RootDirectory\*(C'\fR however mounts a file system hierarchy from a block device node or loopback file instead of a directory. The device node or file system image file needs to contain a file system without a partition table, or a file system within an \s-1MBR/MS\-DOS\s0 or \s-1GPT\s0 partition table with only a single Linux-compatible partition, or a set of file systems within a \s-1GPT\s0 partition table that follows the Discoverable Partitions Specification . .PP When \f(CW\*(C`DevicePolicy\*(C'\fR is set to \f(CW\*(C`closed\*(C'\fR or \&\f(CW\*(C`strict\*(C'\fR, or set to \f(CW\*(C`auto\*(C'\fR and \f(CW\*(C`DeviceAllow\*(C'\fR is set, then this setting adds \f(CW\*(C`/dev/loop\-control\*(C'\fR with \f(CW\*(C`rw\*(C'\fR mode, \&\f(CW\*(C`block\-loop\*(C'\fR and \f(CW\*(C`block\-blkext\*(C'\fR with \f(CW\*(C`rwm\*(C'\fR mode to \f(CW\*(C`DeviceAllow\*(C'\fR. See \&\fBsystemd.resource\-control\fR\|(5) for the details about \f(CW\*(C`DevicePolicy\*(C'\fR or \f(CW\*(C`DeviceAllow\*(C'\fR. Also, see \&\f(CW\*(C`PrivateDevices\*(C'\fR below, as it may change the setting of \&\f(CW\*(C`DevicePolicy\*(C'\fR. .PP Units making use of \f(CW\*(C`RootImage\*(C'\fR automatically gain an \&\f(CW\*(C`After\*(C'\fR dependency on \f(CW\*(C`systemd\-udevd.service\*(C'\fR. \fI Optional. Type uniline. \fR .SS "RootImageOptions" .IX Subsection "RootImageOptions" Takes a comma-separated list of mount options that will be used on disk images specified by \&\f(CW\*(C`RootImage\*(C'\fR. Optionally a partition name can be prefixed, followed by colon, in case the image has multiple partitions, otherwise partition name \f(CW\*(C`root\*(C'\fR is implied. Options for multiple partitions can be specified in a single line with space separators. Assigning an empty string removes previous assignments. Duplicated options are ignored. For a list of valid mount options, please refer to \&\fBmount\fR\|(8). .PP Valid partition names follow the Discoverable Partitions Specification . \fI Optional. Type uniline. \fR .SS "RootHash" .IX Subsection "RootHash" Takes a data integrity (dm-verity) root hash specified in hexadecimal, or the path to a file containing a root hash in \s-1ASCII\s0 hexadecimal format. This option enables data integrity checks using dm-verity, if the used image contains the appropriate integrity data (see above) or if \f(CW\*(C`RootVerity\*(C'\fR is used. The specified hash must match the root hash of integrity data, and is usually at least 256 bits (and hence 64 formatted hexadecimal characters) long (in case of \s-1SHA256\s0 for example). If this option is not specified, but the image file carries the \f(CW\*(C`user.verity.roothash\*(C'\fR extended file attribute (see \fBxattr\fR\|(7)), then the root hash is read from it, also as formatted hexadecimal characters. If the extended file attribute is not found (or is not supported by the underlying file system), but a file with the \f(CW\*(C`.roothash\*(C'\fR suffix is found next to the image file, bearing otherwise the same name (except if the image has the \&\f(CW\*(C`.raw\*(C'\fR suffix, in which case the root hash file must not have it in its name), the root hash is read from it and automatically used, also as formatted hexadecimal characters. .PP If the disk image contains a separate \f(CW\*(C`/usr/\*(C'\fR partition it may also be Verity protected, in which case the root hash may configured via an extended attribute \&\f(CW\*(C`user.verity.usrhash\*(C'\fR or a \f(CW\*(C`.usrhash\*(C'\fR file adjacent to the disk image. There's currently no option to configure the root hash for the \f(CW\*(C`/usr/\*(C'\fR file system via the unit file directly. \fI Optional. Type uniline. \fR .SS "RootHashSignature" .IX Subsection "RootHashSignature" Takes a \s-1PKCS7\s0 signature of the \f(CW\*(C`RootHash\*(C'\fR option as a path to a DER-encoded signature file, or as an \s-1ASCII\s0 base64 string encoding of a DER-encoded signature prefixed by \f(CW\*(C`base64:\*(C'\fR. The dm-verity volume will only be opened if the signature of the root hash is valid and signed by a public key present in the kernel keyring. If this option is not specified, but a file with the \f(CW\*(C`.roothash.p7s\*(C'\fR suffix is found next to the image file, bearing otherwise the same name (except if the image has the \f(CW\*(C`.raw\*(C'\fR suffix, in which case the signature file must not have it in its name), the signature is read from it and automatically used. .PP If the disk image contains a separate \f(CW\*(C`/usr/\*(C'\fR partition it may also be Verity protected, in which case the signature for the root hash may configured via a \&\f(CW\*(C`.usrhash.p7s\*(C'\fR file adjacent to the disk image. There's currently no option to configure the root hash signature for the \f(CW\*(C`/usr/\*(C'\fR via the unit file directly. \fI Optional. Type uniline. \fR .SS "RootVerity" .IX Subsection "RootVerity" Takes the path to a data integrity (dm-verity) file. This option enables data integrity checks using dm-verity, if \f(CW\*(C`RootImage\*(C'\fR is used and a root-hash is passed and if the used image itself does not contains the integrity data. The integrity data must be matched by the root hash. If this option is not specified, but a file with the \f(CW\*(C`.verity\*(C'\fR suffix is found next to the image file, bearing otherwise the same name (except if the image has the \f(CW\*(C`.raw\*(C'\fR suffix, in which case the verity data file must not have it in its name), the verity data is read from it and automatically used. .PP This option is supported only for disk images that contain a single file system, without an enveloping partition table. Images that contain a \s-1GPT\s0 partition table should instead include both root file system and matching Verity data in the same image, implementing the Discoverable Partition Specification . \fI Optional. Type uniline. \fR .SS "MountAPIVFS" .IX Subsection "MountAPIVFS" Takes a boolean argument. If on, a private mount namespace for the unit's processes is created and the \s-1API\s0 file systems \f(CW\*(C`/proc/\*(C'\fR, \f(CW\*(C`/sys/\*(C'\fR, and \f(CW\*(C`/dev/\*(C'\fR are mounted inside of it, unless they are already mounted. Note that this option has no effect unless used in conjunction with \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR as these three mounts are generally mounted in the host anyway, and unless the root directory is changed, the private mount namespace will be a 1:1 copy of the host's, and include these three mounts. Note that the \f(CW\*(C`/dev/\*(C'\fR file system of the host is bind mounted if this option is used without \f(CW\*(C`PrivateDevices\*(C'\fR. To run the service with a private, minimal version of \f(CW\*(C`/dev/\*(C'\fR, combine this option with \&\f(CW\*(C`PrivateDevices\*(C'\fR. \fI Optional. Type boolean. \fR .SS "ProtectProc" .IX Subsection "ProtectProc" Takes one of \f(CW\*(C`noaccess\*(C'\fR, \f(CW\*(C`invisible\*(C'\fR, \&\f(CW\*(C`ptraceable\*(C'\fR or \f(CW\*(C`default\*(C'\fR (which it defaults to). When set, this controls the \f(CW\*(C`hidepid=\*(C'\fR mount option of the \f(CW\*(C`procfs\*(C'\fR instance for the unit that controls which directories with process metainformation (\f(CW\*(C`/proc/PID\*(C'\fR) are visible and accessible: when set to \&\f(CW\*(C`noaccess\*(C'\fR the ability to access most of other users' process metadata in \&\f(CW\*(C`/proc/\*(C'\fR is taken away for processes of the service. When set to \&\f(CW\*(C`invisible\*(C'\fR processes owned by other users are hidden from \&\f(CW\*(C`/proc/\*(C'\fR. If \f(CW\*(C`ptraceable\*(C'\fR all processes that cannot be \&\fBptrace()\fR'ed by a process are hidden to it. If \f(CW\*(C`default\*(C'\fR no restrictions on \f(CW\*(C`/proc/\*(C'\fR access or visibility are made. For further details see The /proc Filesystem . It is generally recommended to run most system services with this option set to \&\f(CW\*(C`invisible\*(C'\fR. This option is implemented via file system namespacing, and thus cannot be used with services that shall be able to install mount points in the host file system hierarchy. It also cannot be used for services that need to access metainformation about other users' processes. This option implies \f(CW\*(C`MountAPIVFS\*(C'\fR. .PP If the kernel doesn't support per-mount point \f(CW\*(C`hidepid=\*(C'\fR mount options this setting remains without effect, and the unit's processes will be able to access and see other process as if the option was not used. \fI Optional. Type enum. choice: 'noaccess', 'invisible', 'ptraceable', 'default'. \fR .SS "ProcSubset" .IX Subsection "ProcSubset" Takes one of \f(CW\*(C`all\*(C'\fR (the default) and \f(CW\*(C`pid\*(C'\fR. If the latter all files and directories not directly associated with process management and introspection are made invisible in the \f(CW\*(C`/proc/\*(C'\fR file system configured for the unit's processes. This controls the \f(CW\*(C`subset=\*(C'\fR mount option of the \f(CW\*(C`procfs\*(C'\fR instance for the unit. For further details see The /proc Filesystem . Note that Linux exposes various kernel APIs via \f(CW\*(C`/proc/\*(C'\fR, which are made unavailable with this setting. Since these APIs are used frequently this option is useful only in a few, specific cases, and is not suitable for most non-trivial programs. .PP Much like \f(CW\*(C`ProtectProc\*(C'\fR above, this is implemented via file system mount namespacing, and hence the same restrictions apply: it is only available to system services, it disables mount propagation to the host mount table, and it implies \&\f(CW\*(C`MountAPIVFS\*(C'\fR. Also, like \f(CW\*(C`ProtectProc\*(C'\fR this setting is gracefully disabled if the used kernel does not support the \f(CW\*(C`subset=\*(C'\fR mount option of \&\f(CW\*(C`procfs\*(C'\fR. \fI Optional. Type enum. choice: 'all', 'pid'. \fR .SS "BindPaths" .IX Subsection "BindPaths" Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit's view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host's mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either \&\f(CW\*(C`rbind\*(C'\fR or \f(CW\*(C`norbind\*(C'\fR for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case it will be ignored when its source path does not exist. .PP \&\f(CW\*(C`BindPaths\*(C'\fR creates regular writable bind mounts (unless the source file system mount is already marked read-only), while \f(CW\*(C`BindReadOnlyPaths\*(C'\fR creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit's list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. .PP This option is particularly useful when \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. .PP Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in \&\f(CW\*(C`InaccessiblePaths\*(C'\fR, or under \f(CW\*(C`/home/\*(C'\fR and other protected directories if \f(CW\*(C`ProtectHome=yes\*(C'\fR is specified. \f(CW\*(C`TemporaryFileSystem\*(C'\fR with \f(CW\*(C`:ro\*(C'\fR or \&\f(CW\*(C`ProtectHome=tmpfs\*(C'\fR should be used instead. \fI Optional. Type list of uniline. \fR .SS "BindReadOnlyPaths" .IX Subsection "BindReadOnlyPaths" Configures unit-specific bind mounts. A bind mount makes a particular file or directory available at an additional place in the unit's view of the file system. Any bind mounts created with this option are specific to the unit, and are not visible in the host's mount table. This option expects a whitespace separated list of bind mount definitions. Each definition consists of a colon-separated triple of source path, destination path and option string, where the latter two are optional. If only a source path is specified the source and destination is taken to be the same. The option string may be either \&\f(CW\*(C`rbind\*(C'\fR or \f(CW\*(C`norbind\*(C'\fR for configuring a recursive or non-recursive bind mount. If the destination path is omitted, the option string must be omitted too. Each bind mount definition may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case it will be ignored when its source path does not exist. .PP \&\f(CW\*(C`BindPaths\*(C'\fR creates regular writable bind mounts (unless the source file system mount is already marked read-only), while \f(CW\*(C`BindReadOnlyPaths\*(C'\fR creates read-only bind mounts. These settings may be used more than once, each usage appends to the unit's list of bind mounts. If the empty string is assigned to either of these two options the entire list of bind mounts defined prior to this is reset. Note that in this case both read-only and regular bind mounts are reset, regardless which of the two settings is used. .PP This option is particularly useful when \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR is used. In this case the source path refers to a path on the host file system, while the destination path refers to a path below the root directory of the unit. .PP Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in \&\f(CW\*(C`InaccessiblePaths\*(C'\fR, or under \f(CW\*(C`/home/\*(C'\fR and other protected directories if \f(CW\*(C`ProtectHome=yes\*(C'\fR is specified. \f(CW\*(C`TemporaryFileSystem\*(C'\fR with \f(CW\*(C`:ro\*(C'\fR or \&\f(CW\*(C`ProtectHome=tmpfs\*(C'\fR should be used instead. \fI Optional. Type list of uniline. \fR .SS "MountImages" .IX Subsection "MountImages" This setting is similar to \f(CW\*(C`RootImage\*(C'\fR in that it mounts a file system hierarchy from a block device node or loopback file, but the destination directory can be specified as well as mount options. This option expects a whitespace separated list of mount definitions. Each definition consists of a colon-separated tuple of source path and destination definitions, optionally followed by another colon and a list of mount options. .PP Mount options may be defined as a single comma-separated list of options, in which case they will be implicitly applied to the root partition on the image, or a series of colon-separated tuples of partition name and mount options. Valid partition names and mount options are the same as for \&\f(CW\*(C`RootImageOptions\*(C'\fR setting described above. .PP Each mount definition may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case it will be ignored when its source path does not exist. The source argument is a path to a block device node or regular file. If source or destination contain a \f(CW\*(C`:\*(C'\fR, it needs to be escaped as \&\f(CW\*(C`\e:\*(C'\fR. The device node or file system image file needs to follow the same rules as specified for \f(CW\*(C`RootImage\*(C'\fR. Any mounts created with this option are specific to the unit, and are not visible in the host's mount table. .PP These settings may be used more than once, each usage appends to the unit's list of mount paths. If the empty string is assigned, the entire list of mount paths defined prior to this is reset. .PP Note that the destination directory must exist or systemd must be able to create it. Thus, it is not possible to use those options for mount points nested underneath paths specified in \&\f(CW\*(C`InaccessiblePaths\*(C'\fR, or under \f(CW\*(C`/home/\*(C'\fR and other protected directories if \f(CW\*(C`ProtectHome=yes\*(C'\fR is specified. .PP When \f(CW\*(C`DevicePolicy\*(C'\fR is set to \f(CW\*(C`closed\*(C'\fR or \&\f(CW\*(C`strict\*(C'\fR, or set to \f(CW\*(C`auto\*(C'\fR and \f(CW\*(C`DeviceAllow\*(C'\fR is set, then this setting adds \f(CW\*(C`/dev/loop\-control\*(C'\fR with \f(CW\*(C`rw\*(C'\fR mode, \&\f(CW\*(C`block\-loop\*(C'\fR and \f(CW\*(C`block\-blkext\*(C'\fR with \f(CW\*(C`rwm\*(C'\fR mode to \f(CW\*(C`DeviceAllow\*(C'\fR. See \&\fBsystemd.resource\-control\fR\|(5) for the details about \f(CW\*(C`DevicePolicy\*(C'\fR or \f(CW\*(C`DeviceAllow\*(C'\fR. Also, see \&\f(CW\*(C`PrivateDevices\*(C'\fR below, as it may change the setting of \&\f(CW\*(C`DevicePolicy\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "User" .IX Subsection "User" Set the \s-1UNIX\s0 user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric \s-1ID\s0 as argument. For system services (services run by the system service manager, i.e. managed by \s-1PID 1\s0) and for user services of the root user (services managed by root's instance of systemd \-\-user), the default is \f(CW\*(C`root\*(C'\fR, but \f(CW\*(C`User\*(C'\fR may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with \f(CW\*(C`+\*(C'\fR. .PP Note that this enforces only weak restrictions on the user/group name syntax, but will generate warnings in many cases where user/group names do not adhere to the following rules: the specified name should consist only of the characters a\-z, A\-Z, 0\-9, \f(CW\*(C`_\*(C'\fR and \&\f(CW\*(C`\-\*(C'\fR, except for the first character which must be one of a\-z, A\-Z and \&\f(CW\*(C`_\*(C'\fR (i.e. digits and \f(CW\*(C`\-\*(C'\fR are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are made in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. For further details on the names accepted and the names warned about see User/Group Name Syntax . .PP When used in conjunction with \f(CW\*(C`DynamicUser\*(C'\fR the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped X unless it is already allocated statically (see below). If \f(CW\*(C`DynamicUser\*(C'\fR is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the \&\fBsysusers.d\fR\|(5) facility, which is applied at boot or package install time. If the user does not exist by then program invocation will fail. .PP If the \f(CW\*(C`User\*(C'\fR setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the \f(CW\*(C`SupplementaryGroups\*(C'\fR setting (see below). \fI Optional. Type uniline. \fR .SS "Group" .IX Subsection "Group" Set the \s-1UNIX\s0 user or group that the processes are executed as, respectively. Takes a single user or group name, or a numeric \s-1ID\s0 as argument. For system services (services run by the system service manager, i.e. managed by \s-1PID 1\s0) and for user services of the root user (services managed by root's instance of systemd \-\-user), the default is \f(CW\*(C`root\*(C'\fR, but \f(CW\*(C`User\*(C'\fR may be used to specify a different user. For user services of any other user, switching user identity is not permitted, hence the only valid setting is the same user the user's service manager is running as. If no group is set, the default group of the user is used. This setting does not affect commands whose command line is prefixed with \f(CW\*(C`+\*(C'\fR. .PP Note that this enforces only weak restrictions on the user/group name syntax, but will generate warnings in many cases where user/group names do not adhere to the following rules: the specified name should consist only of the characters a\-z, A\-Z, 0\-9, \f(CW\*(C`_\*(C'\fR and \&\f(CW\*(C`\-\*(C'\fR, except for the first character which must be one of a\-z, A\-Z and \&\f(CW\*(C`_\*(C'\fR (i.e. digits and \f(CW\*(C`\-\*(C'\fR are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are made in order to avoid ambiguities and to ensure user/group names and unit files remain portable among Linux systems. For further details on the names accepted and the names warned about see User/Group Name Syntax . .PP When used in conjunction with \f(CW\*(C`DynamicUser\*(C'\fR the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped X unless it is already allocated statically (see below). If \f(CW\*(C`DynamicUser\*(C'\fR is not used the specified user and group must have been created statically in the user database no later than the moment the service is started, for example using the \&\fBsysusers.d\fR\|(5) facility, which is applied at boot or package install time. If the user does not exist by then program invocation will fail. .PP If the \f(CW\*(C`User\*(C'\fR setting is used the supplementary group list is initialized from the specified user's default group list, as defined in the system's user and group database. Additional groups may be configured through the \f(CW\*(C`SupplementaryGroups\*(C'\fR setting (see below). \fI Optional. Type uniline. \fR .SS "DynamicUser" .IX Subsection "DynamicUser" Takes a boolean parameter. If set, a \s-1UNIX\s0 user and group pair is allocated dynamically when the unit is started, and released as soon as it is stopped. The user and group will not be added to \f(CW\*(C`/etc/passwd\*(C'\fR or \f(CW\*(C`/etc/group\*(C'\fR, but are managed transiently during runtime. The \&\fBnss\-systemd\fR\|(8) glibc \&\s-1NSS\s0 module provides integration of these dynamic users/groups into the system's user and group databases. The user and group name to use may be configured via \f(CW\*(C`User\*(C'\fR and \&\f(CW\*(C`Group\*(C'\fR (see above). If these options are not used and dynamic user/group allocation is enabled for a unit, the name of the dynamic user/group is implicitly derived from the unit name. If the unit name without the type suffix qualifies as valid user name it is used directly, otherwise a name incorporating a hash of it is used. If a statically allocated user or group of the configured name already exists, it is used and no dynamic user/group is allocated. Note that if \&\f(CW\*(C`User\*(C'\fR is specified and the static group with the name exists, then it is required that the static user with the name already exists. Similarly, if \f(CW\*(C`Group\*(C'\fR is specified and the static user with the name exists, then it is required that the static group with the name already exists. Dynamic users/groups are allocated from the \s-1UID/GID\s0 range 61184X65519. It is recommended to avoid this range for regular system or login users. At any point in time each \s-1UID/GID\s0 from this range is only assigned to zero or one dynamically allocated users/groups in use. However, UID/GIDs are recycled after a unit is terminated. Care should be taken that any processes running as part of a unit for which dynamic users/groups are enabled do not leave files or directories owned by these users/groups around, as a different unit might get the same \s-1UID/GID\s0 assigned later on, and thus gain access to these files or directories. If \f(CW\*(C`DynamicUser\*(C'\fR is enabled, \&\f(CW\*(C`RemoveIPC\*(C'\fR and \f(CW\*(C`PrivateTmp\*(C'\fR are implied (and cannot be turned off). This ensures that the lifetime of \s-1IPC\s0 objects and temporary files created by the executed processes is bound to the runtime of the service, and hence the lifetime of the dynamic user/group. Since \f(CW\*(C`/tmp/\*(C'\fR and \f(CW\*(C`/var/tmp/\*(C'\fR are usually the only world-writable directories on a system this ensures that a unit making use of dynamic user/group allocation cannot leave files around after unit termination. Furthermore \&\f(CW\*(C`NoNewPrivileges\*(C'\fR and \f(CW\*(C`RestrictSUIDSGID\*(C'\fR are implicitly enabled (and cannot be disabled), to ensure that processes invoked cannot take benefit or create \s-1SUID/SGID\s0 files or directories. Moreover \f(CW\*(C`ProtectSystem=strict\*(C'\fR and \&\f(CW\*(C`ProtectHome=read\-only\*(C'\fR are implied, thus prohibiting the service to write to arbitrary file system locations. In order to allow the service to write to certain directories, they have to be allow-listed using \f(CW\*(C`ReadWritePaths\*(C'\fR, but care must be taken so that \&\s-1UID/GID\s0 recycling doesn't create security issues involving files created by the service. Use \&\f(CW\*(C`RuntimeDirectory\*(C'\fR (see below) in order to assign a writable runtime directory to a service, owned by the dynamic user/group and removed automatically when the unit is terminated. Use \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR in order to assign a set of writable directories for specific purposes to the service in a way that they are protected from vulnerabilities due to \s-1UID\s0 reuse (see below). If this option is enabled, care should be taken that the unit's processes do not get access to directories outside of these explicitly configured and managed ones. Specifically, do not use \&\f(CW\*(C`BindPaths\*(C'\fR and be careful with \f(CW\*(C`AF_UNIX\*(C'\fR file descriptor passing for directory file descriptors, as this would permit processes to create files or directories owned by the dynamic user/group that are not subject to the lifecycle and access guarantees of the service. Defaults to off. \fI Optional. Type boolean. \fR .SS "SupplementaryGroups" .IX Subsection "SupplementaryGroups" Sets the supplementary Unix groups the processes are executed as. This takes a space-separated list of group names or IDs. This option may be specified more than once, in which case all listed groups are set as supplementary groups. When the empty string is assigned, the list of supplementary groups is reset, and all assignments prior to this one will have no effect. In any way, this option does not override, but extends the list of supplementary groups configured in the system group database for the user. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "PAMName" .IX Subsection "PAMName" Sets the \s-1PAM\s0 service name to set up a session as. If set, the executed process will be registered as a \s-1PAM\s0 session under the specified service name. This is only useful in conjunction with the \&\f(CW\*(C`User\*(C'\fR setting, and is otherwise ignored. If not set, no \s-1PAM\s0 session will be opened for the executed processes. See \fBpam\fR\|(8) for details. .PP Note that for each unit making use of this option a \s-1PAM\s0 session handler process will be maintained as part of the unit and stays around as long as the unit is active, to ensure that appropriate actions can be taken when the unit and hence the \s-1PAM\s0 session terminates. This process is named \f(CW\*(C`(sd\-pam)\*(C'\fR and is an immediate child process of the unit's main process. .PP Note that when this option is used for a unit it is very likely (depending on \s-1PAM\s0 configuration) that the main unit process will be migrated to its own session scope unit when it is activated. This process will hence be associated with two units: the unit it was originally started from (and for which \&\f(CW\*(C`PAMName\*(C'\fR was configured), and the session scope unit. Any child processes of that process will however be associated with the session scope unit only. This has implications when used in combination with \f(CW\*(C`NotifyAccess\*(C'\fR\f(CW\*(C`all\*(C'\fR, as these child processes will not be able to affect changes in the original unit through notification messages. These messages will be considered belonging to the session scope unit and not the original unit. It is hence not recommended to use \f(CW\*(C`PAMName\*(C'\fR in combination with \f(CW\*(C`NotifyAccess\*(C'\fR\f(CW\*(C`all\*(C'\fR. \fI Optional. Type uniline. \fR .SS "CapabilityBoundingSet" .IX Subsection "CapabilityBoundingSet" Controls which capabilities to include in the capability bounding set for the executed process. See \fBcapabilities\fR\|(7) for details. Takes a whitespace-separated list of capability names, e.g. \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR, \f(CW\*(C`CAP_DAC_OVERRIDE\*(C'\fR, \&\f(CW\*(C`CAP_SYS_PTRACE\*(C'\fR. Capabilities listed will be included in the bounding set, all others are removed. If the list of capabilities is prefixed with \f(CW\*(C`~\*(C'\fR, all but the listed capabilities will be included, the effect of the assignment inverted. Note that this option also affects the respective capabilities in the effective, permitted and inheritable capability sets. If this option is not used, the capability bounding set is not modified on process execution, hence no limits on the capabilities of the process are enforced. This option may appear more than once, in which case the bounding sets are merged by \f(CW\*(C`OR\*(C'\fR, or by \&\f(CW\*(C`AND\*(C'\fR if the lines are prefixed with \f(CW\*(C`~\*(C'\fR (see below). If the empty string is assigned to this option, the bounding set is reset to the empty capability set, and all prior settings have no effect. If set to \f(CW\*(C`~\*(C'\fR (without any further argument), the bounding set is reset to the full set of available capabilities, also undoing any previous settings. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. .PP Use \&\fBsystemd\-analyze\fR\|(1)'s capability command to retrieve a list of capabilities defined on the local system. .PP Example: if a unit has the following, .PP .Vb 2 \& CapabilityBoundingSet=CAP_A CAP_B \& CapabilityBoundingSet=CAP_B CAP_C .Ve .PP then \f(CW\*(C`CAP_A\*(C'\fR, \f(CW\*(C`CAP_B\*(C'\fR, and \&\f(CW\*(C`CAP_C\*(C'\fR are set. If the second line is prefixed with \&\f(CW\*(C`~\*(C'\fR, e.g., .PP .Vb 2 \& CapabilityBoundingSet=CAP_A CAP_B \& CapabilityBoundingSet=~CAP_B CAP_C .Ve .PP then, only \f(CW\*(C`CAP_A\*(C'\fR is set. \fI Optional. Type uniline. \fR .SS "AmbientCapabilities" .IX Subsection "AmbientCapabilities" Controls which capabilities to include in the ambient capability set for the executed process. Takes a whitespace-separated list of capability names, e.g. \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR, \&\f(CW\*(C`CAP_DAC_OVERRIDE\*(C'\fR, \f(CW\*(C`CAP_SYS_PTRACE\*(C'\fR. This option may appear more than once in which case the ambient capability sets are merged (see the above examples in \&\f(CW\*(C`CapabilityBoundingSet\*(C'\fR). If the list of capabilities is prefixed with \f(CW\*(C`~\*(C'\fR, all but the listed capabilities will be included, the effect of the assignment inverted. If the empty string is assigned to this option, the ambient capability set is reset to the empty capability set, and all prior settings have no effect. If set to \f(CW\*(C`~\*(C'\fR (without any further argument), the ambient capability set is reset to the full set of available capabilities, also undoing any previous settings. Note that adding capabilities to ambient capability set adds them to the process's inherited capability set. .PP Ambient capability sets are useful if you want to execute a process as a non-privileged user but still want to give it some capabilities. Note that in this case option \f(CW\*(C`keep\-caps\*(C'\fR is automatically added to \f(CW\*(C`SecureBits\*(C'\fR to retain the capabilities over the user change. \f(CW\*(C`AmbientCapabilities\*(C'\fR does not affect commands prefixed with \&\f(CW\*(C`+\*(C'\fR. \fI Optional. Type uniline. \fR .SS "NoNewPrivileges" .IX Subsection "NoNewPrivileges" Takes a boolean argument. If true, ensures that the service process and all its children can never gain new privileges through \fBexecve()\fR (e.g. via setuid or setgid bits, or filesystem capabilities). This is the simplest and most effective way to ensure that a process and its children can never elevate privileges again. Defaults to false, but certain settings override this and ignore the value of this setting. This is the case when \&\f(CW\*(C`SystemCallFilter\*(C'\fR, \f(CW\*(C`SystemCallArchitectures\*(C'\fR, \&\f(CW\*(C`RestrictAddressFamilies\*(C'\fR, \f(CW\*(C`RestrictNamespaces\*(C'\fR, \&\f(CW\*(C`PrivateDevices\*(C'\fR, \f(CW\*(C`ProtectKernelTunables\*(C'\fR, \&\f(CW\*(C`ProtectKernelModules\*(C'\fR, \f(CW\*(C`ProtectKernelLogs\*(C'\fR, \&\f(CW\*(C`ProtectClock\*(C'\fR, \f(CW\*(C`MemoryDenyWriteExecute\*(C'\fR, \&\f(CW\*(C`RestrictRealtime\*(C'\fR, \f(CW\*(C`RestrictSUIDSGID\*(C'\fR, \f(CW\*(C`DynamicUser\*(C'\fR or \f(CW\*(C`LockPersonality\*(C'\fR are specified. Note that even if this setting is overridden by them, systemctl show shows the original value of this setting. Also see No New Privileges Flag . \fI Optional. Type boolean. \fR .SS "SecureBits" .IX Subsection "SecureBits" Controls the secure bits set for the executed process. Takes a space-separated combination of options from the following list: \f(CW\*(C`keep\-caps\*(C'\fR, \f(CW\*(C`keep\-caps\-locked\*(C'\fR, \&\f(CW\*(C`no\-setuid\-fixup\*(C'\fR, \f(CW\*(C`no\-setuid\-fixup\-locked\*(C'\fR, \f(CW\*(C`noroot\*(C'\fR, and \&\f(CW\*(C`noroot\-locked\*(C'\fR. This option may appear more than once, in which case the secure bits are ORed. If the empty string is assigned to this option, the bits are reset to 0. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. See \fBcapabilities\fR\|(7) for details. \fI Optional. Type uniline. \fR .SS "SELinuxContext" .IX Subsection "SELinuxContext" Set the SELinux security context of the executed process. If set, this will override the automated domain transition. However, the policy still needs to authorize the transition. This directive is ignored if SELinux is disabled. If prefixed by \f(CW\*(C`\-\*(C'\fR, all errors will be ignored. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. See \fBsetexeccon\fR\|(3) for details. \fI Optional. Type uniline. \fR .SS "AppArmorProfile" .IX Subsection "AppArmorProfile" Takes a profile name as argument. The process executed by the unit will switch to this profile when started. Profiles must already be loaded in the kernel, or the unit will fail. If prefixed by \f(CW\*(C`\-\*(C'\fR, all errors will be ignored. This setting has no effect if AppArmor is not enabled. This setting does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. \fI Optional. Type uniline. \fR .SS "SmackProcessLabel" .IX Subsection "SmackProcessLabel" Takes a \f(CW\*(C`SMACK64\*(C'\fR security label as argument. The process executed by the unit will be started under this label and \s-1SMACK\s0 will decide whether the process is allowed to run or not, based on it. The process will continue to run under the label specified here unless the executable has its own \&\f(CW\*(C`SMACK64EXEC\*(C'\fR label, in which case the process will transition to run under that label. When not specified, the label that systemd is running under is used. This directive is ignored if \s-1SMACK\s0 is disabled. .PP The value may be prefixed by \f(CW\*(C`\-\*(C'\fR, in which case all errors will be ignored. An empty value may be specified to unset previous assignments. This does not affect commands prefixed with \&\f(CW\*(C`+\*(C'\fR. \fI Optional. Type uniline. \fR .SS "LimitCPU" .IX Subsection "LimitCPU" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitFSIZE" .IX Subsection "LimitFSIZE" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitDATA" .IX Subsection "LimitDATA" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitSTACK" .IX Subsection "LimitSTACK" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitCORE" .IX Subsection "LimitCORE" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitRSS" .IX Subsection "LimitRSS" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitNOFILE" .IX Subsection "LimitNOFILE" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitAS" .IX Subsection "LimitAS" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitNPROC" .IX Subsection "LimitNPROC" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitMEMLOCK" .IX Subsection "LimitMEMLOCK" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitLOCKS" .IX Subsection "LimitLOCKS" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitSIGPENDING" .IX Subsection "LimitSIGPENDING" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitMSGQUEUE" .IX Subsection "LimitMSGQUEUE" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitNICE" .IX Subsection "LimitNICE" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitRTPRIO" .IX Subsection "LimitRTPRIO" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "LimitRTTIME" .IX Subsection "LimitRTTIME" Set soft and hard limits on various resources for executed processes. See \&\fBsetrlimit\fR\|(2) for details on the resource limit concept. Resource limits may be specified in two formats: either as single value to set a specific soft and hard limit to the same value, or as colon-separated pair \&\f(CW\*(C`soft:hard\*(C'\fR to set both limits individually (e.g. \f(CW\*(C`LimitAS=4G:16G\*(C'\fR). Use the string \f(CW\*(C`infinity\*(C'\fR to configure no limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may be used for resource limits measured in bytes (e.g. \f(CW\*(C`LimitAS=16G\*(C'\fR). For the limits referring to time values, the usual time units ms, s, min, h and so on may be used (see \&\fBsystemd.time\fR\|(7) for details). Note that if no time unit is specified for \f(CW\*(C`LimitCPU\*(C'\fR the default unit of seconds is implied, while for \f(CW\*(C`LimitRTTIME\*(C'\fR the default unit of microseconds is implied. Also, note that the effective granularity of the limits might influence their enforcement. For example, time limits specified for \f(CW\*(C`LimitCPU\*(C'\fR will be rounded up implicitly to multiples of 1s. For \f(CW\*(C`LimitNICE\*(C'\fR the value may be specified in two syntaxes: if prefixed with \f(CW\*(C`+\*(C'\fR or \f(CW\*(C`\-\*(C'\fR, the value is understood as regular Linux nice value in the range \-20..19. If not prefixed like this the value is understood as raw resource limit parameter in the range 0..40 (with 0 being equivalent to 1). .PP Note that most process resource limits configured with these options are per-process, and processes may fork in order to acquire a new set of resources that are accounted independently of the original process, and may thus escape limits set. Also note that \f(CW\*(C`LimitRSS\*(C'\fR is not implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource controls listed in \&\fBsystemd.resource\-control\fR\|(5) over these per-process limits, as they apply to services as a whole, may be altered dynamically at runtime, and are generally more expressive. For example, \f(CW\*(C`MemoryMax\*(C'\fR is a more powerful (and working) replacement for \f(CW\*(C`LimitRSS\*(C'\fR. .PP Resource limits not configured explicitly for a unit default to the value configured in the various \&\f(CW\*(C`DefaultLimitCPU\*(C'\fR, \f(CW\*(C`DefaultLimitFSIZE\*(C'\fR, X options available in \&\fBsystemd\-system.conf\fR\|(5), and X if not configured there X the kernel or per-user defaults, as defined by the \s-1OS\s0 (the latter only for user services, see below). .PP For system units these resource limits may be chosen freely. When these settings are configured in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be used to raise the limits above those set for the user manager itself when it was first invoked, as the user's service manager generally lacks the privileges to do so. In user context these configuration options are hence only useful to lower the limits passed in or to raise the soft limit to the maximum of the hard limit as configured for the user. To raise the user's limits further, the available configuration mechanisms differ between operating systems, but typically require privileges. In most cases it is possible to configure higher per-user resource limits via \s-1PAM\s0 or by setting limits on the system service encapsulating the user's service manager, i.e. the user's instance of \f(CW\*(C`user@.service\*(C'\fR. After making such changes, make sure to restart the user's service manager. \fI Optional. Type uniline. \fR .SS "UMask" .IX Subsection "UMask" Controls the file mode creation mask. Takes an access mode in octal notation. See \&\fBumask\fR\|(2) for details. Defaults to 0022 for system units. For user units the default value is inherited from the per-user service manager (whose default is in turn inherited from the system service manager, and thus typically also is 0022 X unless overridden by a \s-1PAM\s0 module). In order to change the per-user mask for all user services, consider setting the \f(CW\*(C`UMask\*(C'\fR setting of the user's \&\f(CW\*(C`user@.service\*(C'\fR system service instance. The per-user umask may also be set via the \f(CW\*(C`umask\*(C'\fR field of a user's \s-1JSON\s0 User Record (for users managed by \&\fBsystemd\-homed.service\fR\|(8) this field may be controlled via homectl \-\-umask=). It may also be set via a \s-1PAM\s0 module, such as \fBpam_umask\fR\|(8). \fI Optional. Type uniline. \fR .SS "CoredumpFilter" .IX Subsection "CoredumpFilter" Controls which types of memory mappings will be saved if the process dumps core (using the \f(CW\*(C`/proc/pid/coredump_filter\*(C'\fR file). Takes a whitespace-separated combination of mapping type names or numbers (with the default base 16). Mapping type names are \f(CW\*(C`private\-anonymous\*(C'\fR, \f(CW\*(C`shared\-anonymous\*(C'\fR, \&\f(CW\*(C`private\-file\-backed\*(C'\fR, \f(CW\*(C`shared\-file\-backed\*(C'\fR, \&\f(CW\*(C`elf\-headers\*(C'\fR, \f(CW\*(C`private\-huge\*(C'\fR, \&\f(CW\*(C`shared\-huge\*(C'\fR, \f(CW\*(C`private\-dax\*(C'\fR, \f(CW\*(C`shared\-dax\*(C'\fR, and the special values \f(CW\*(C`all\*(C'\fR (all types) and \f(CW\*(C`default\*(C'\fR (the kernel default of \f(CW\*(C`\f(CW\*(C`private\-anonymous\*(C'\f(CW\f(CW\*(C`shared\-anonymous\*(C'\f(CW \f(CW\*(C`elf\-headers\*(C'\f(CW\f(CW\*(C`private\-huge\*(C'\f(CW\*(C'\fR). See \&\fBcore\fR\|(5) for the meaning of the mapping types. When specified multiple times, all specified masks are ORed. When not set, or if the empty value is assigned, the inherited value is not changed. \fI Optional. Type uniline. \fR .SS "KeyringMode" .IX Subsection "KeyringMode" Controls how the kernel session keyring is set up for the service (see \fBsession\-keyring\fR\|(7) for details on the session keyring). Takes one of \f(CW\*(C`inherit\*(C'\fR, \f(CW\*(C`private\*(C'\fR, \&\f(CW\*(C`shared\*(C'\fR. If set to \f(CW\*(C`inherit\*(C'\fR no special keyring setup is done, and the kernel's default behaviour is applied. If \f(CW\*(C`private\*(C'\fR is used a new session keyring is allocated when a service process is invoked, and it is not linked up with any user keyring. This is the recommended setting for system services, as this ensures that multiple services running under the same system user \s-1ID\s0 (in particular the root user) do not share their key material among each other. If \f(CW\*(C`shared\*(C'\fR is used a new session keyring is allocated as for \f(CW\*(C`private\*(C'\fR, but the user keyring of the user configured with \&\f(CW\*(C`User\*(C'\fR is linked into it, so that keys assigned to the user may be requested by the unit's processes. In this modes multiple units running processes under the same user \s-1ID\s0 may share key material. Unless \&\f(CW\*(C`inherit\*(C'\fR is selected the unique invocation \s-1ID\s0 for the unit (see below) is added as a protected key by the name \f(CW\*(C`invocation_id\*(C'\fR to the newly created session keyring. Defaults to \&\f(CW\*(C`private\*(C'\fR for services of the system service manager and to \f(CW\*(C`inherit\*(C'\fR for non-service units and for services of the user service manager. \fI Optional. Type enum. choice: 'inherit', 'private', 'shared'. \fR .SS "OOMScoreAdjust" .IX Subsection "OOMScoreAdjust" Sets the adjustment value for the Linux kernel's Out-Of-Memory (\s-1OOM\s0) killer score for executed processes. Takes an integer between \-1000 (to disable \s-1OOM\s0 killing of processes of this unit) and 1000 (to make killing of processes of this unit under memory pressure very likely). See proc.txt for details. If not specified defaults to the \s-1OOM\s0 score adjustment level of the service manager itself, which is normally at 0. .PP Use the \f(CW\*(C`OOMPolicy\*(C'\fR setting of service units to configure how the service manager shall react to the kernel \s-1OOM\s0 killer terminating a process of the service. See \&\fBsystemd.service\fR\|(5) for details. \fI Optional. Type integer. \fR .SS "TimerSlackNSec" .IX Subsection "TimerSlackNSec" Sets the timer slack in nanoseconds for the executed processes. The timer slack controls the accuracy of wake-ups triggered by timers. See \&\fBprctl\fR\|(2) for more information. Note that in contrast to most other time span definitions this parameter takes an integer value in nano-seconds if no unit is specified. The usual time units are understood too. \fI Optional. Type uniline. \fR .SS "Personality" .IX Subsection "Personality" Controls which kernel architecture \fBuname\fR\|(2) shall report, when invoked by unit processes. Takes one of the architecture identifiers \f(CW\*(C`x86\*(C'\fR, \&\f(CW\*(C`x86\-64\*(C'\fR, \f(CW\*(C`ppc\*(C'\fR, \f(CW\*(C`ppc\-le\*(C'\fR, \f(CW\*(C`ppc64\*(C'\fR, \&\f(CW\*(C`ppc64\-le\*(C'\fR, \f(CW\*(C`s390\*(C'\fR or \f(CW\*(C`s390x\*(C'\fR. Which personality architectures are supported depends on the system architecture. Usually the 64bit versions of the various system architectures support their immediate 32bit personality architecture counterpart, but no others. For example, \f(CW\*(C`x86\-64\*(C'\fR systems support the \f(CW\*(C`x86\-64\*(C'\fR and \&\f(CW\*(C`x86\*(C'\fR personalities but no others. The personality feature is useful when running 32\-bit services on a 64\-bit host system. If not specified, the personality is left unmodified and thus reflects the personality of the host system's kernel. \fI Optional. Type enum. choice: 'x86', 'x86\-64', 'ppc', 'ppc\-le', 'ppc64', 'ppc64\-le', 's390', 's390x'. \fR .SS "IgnoreSIGPIPE" .IX Subsection "IgnoreSIGPIPE" Takes a boolean argument. If true, causes \f(CW\*(C`SIGPIPE\*(C'\fR to be ignored in the executed process. Defaults to true because \f(CW\*(C`SIGPIPE\*(C'\fR generally is useful only in shell pipelines. \fI Optional. Type boolean. \fR .SS "Nice" .IX Subsection "Nice" Sets the default nice level (scheduling priority) for executed processes. Takes an integer between \-20 (highest priority) and 19 (lowest priority). See \&\fBsetpriority\fR\|(2) for details. \fI Optional. Type integer. \fR .SS "CPUSchedulingPolicy" .IX Subsection "CPUSchedulingPolicy" Sets the \s-1CPU\s0 scheduling policy for executed processes. Takes one of \f(CW\*(C`other\*(C'\fR, \&\f(CW\*(C`batch\*(C'\fR, \f(CW\*(C`idle\*(C'\fR, \f(CW\*(C`fifo\*(C'\fR or \f(CW\*(C`rr\*(C'\fR. See \&\fBsched_setscheduler\fR\|(2) for details. \fI Optional. Type enum. choice: 'other', 'batch', 'idle', 'fifo', 'rr'. \fR .SS "CPUSchedulingPriority" .IX Subsection "CPUSchedulingPriority" Sets the \s-1CPU\s0 scheduling priority for executed processes. The available priority range depends on the selected \s-1CPU\s0 scheduling policy (see above). For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority) can be used. See \&\fBsched_setscheduler\fR\|(2) for details. \fI Optional. Type uniline. \fR .SS "CPUSchedulingResetOnFork" .IX Subsection "CPUSchedulingResetOnFork" Takes a boolean argument. If true, elevated \s-1CPU\s0 scheduling priorities and policies will be reset when the executed processes call \&\fBfork\fR\|(2), and can hence not leak into child processes. See \&\fBsched_setscheduler\fR\|(2) for details. Defaults to false. \fI Optional. Type boolean. \fR .SS "CPUAffinity" .IX Subsection "CPUAffinity" Controls the \s-1CPU\s0 affinity of the executed processes. Takes a list of \s-1CPU\s0 indices or ranges separated by either whitespace or commas. Alternatively, takes a special \*(L"numa\*(R" value in which case systemd automatically derives allowed \s-1CPU\s0 range based on the value of \f(CW\*(C`NUMAMask\*(C'\fR option. \s-1CPU\s0 ranges are specified by the lower and upper \s-1CPU\s0 indices separated by a dash. This option may be specified more than once, in which case the specified \s-1CPU\s0 affinity masks are merged. If the empty string is assigned, the mask is reset, all assignments prior to this will have no effect. See \&\fBsched_setaffinity\fR\|(2) for details. \fI Optional. Type list of uniline. \fR .SS "NUMAPolicy" .IX Subsection "NUMAPolicy" Controls the \s-1NUMA\s0 memory policy of the executed processes. Takes a policy type, one of: \&\f(CW\*(C`default\*(C'\fR, \f(CW\*(C`preferred\*(C'\fR, \f(CW\*(C`bind\*(C'\fR, \f(CW\*(C`interleave\*(C'\fR and \&\f(CW\*(C`local\*(C'\fR. A list of \s-1NUMA\s0 nodes that should be associated with the policy must be specified in \f(CW\*(C`NUMAMask\*(C'\fR. For more details on each policy please see, \&\fBset_mempolicy\fR\|(2). For overall overview of \s-1NUMA\s0 support in Linux see, \&\fBnuma\fR\|(7). \&\fI Optional. Type uniline. \fR .SS "NUMAMask" .IX Subsection "NUMAMask" Controls the \s-1NUMA\s0 node list which will be applied alongside with selected \s-1NUMA\s0 policy. Takes a list of \s-1NUMA\s0 nodes and has the same syntax as a list of CPUs for \f(CW\*(C`CPUAffinity\*(C'\fR option or special \*(L"all\*(R" value which will include all available \s-1NUMA\s0 nodes in the mask. Note that the list of \s-1NUMA\s0 nodes is not required for \f(CW\*(C`default\*(C'\fR and \f(CW\*(C`local\*(C'\fR policies and for \f(CW\*(C`preferred\*(C'\fR policy we expect a single \s-1NUMA\s0 node. \fI Optional. Type uniline. \fR .SS "IOSchedulingClass" .IX Subsection "IOSchedulingClass" Sets the I/O scheduling class for executed processes. Takes an integer between 0 and 3 or one of the strings \f(CW\*(C`none\*(C'\fR, \f(CW\*(C`realtime\*(C'\fR, \f(CW\*(C`best\-effort\*(C'\fR or \&\f(CW\*(C`idle\*(C'\fR. If the empty string is assigned to this option, all prior assignments to both \&\f(CW\*(C`IOSchedulingClass\*(C'\fR and \f(CW\*(C`IOSchedulingPriority\*(C'\fR have no effect. See \&\fBioprio_set\fR\|(2) for details. \fI Optional. Type enum. choice: '0', '1', '2', '3', 'none', 'realtime', 'best\-effort', 'idle'. \fR .SS "IOSchedulingPriority" .IX Subsection "IOSchedulingPriority" Sets the I/O scheduling priority for executed processes. Takes an integer between 0 (highest priority) and 7 (lowest priority). The available priorities depend on the selected I/O scheduling class (see above). If the empty string is assigned to this option, all prior assignments to both \&\f(CW\*(C`IOSchedulingClass\*(C'\fR and \f(CW\*(C`IOSchedulingPriority\*(C'\fR have no effect. See \fBioprio_set\fR\|(2) for details. \fI Optional. Type integer. \fR .SS "ProtectSystem" .IX Subsection "ProtectSystem" Takes a boolean argument or the special values \f(CW\*(C`full\*(C'\fR or \&\f(CW\*(C`strict\*(C'\fR. If true, mounts the \f(CW\*(C`/usr/\*(C'\fR and the boot loader directories (\f(CW\*(C`/boot\*(C'\fR and \f(CW\*(C`/efi\*(C'\fR) read-only for processes invoked by this unit. If set to \f(CW\*(C`full\*(C'\fR, the \f(CW\*(C`/etc/\*(C'\fR directory is mounted read-only, too. If set to \f(CW\*(C`strict\*(C'\fR the entire file system hierarchy is mounted read-only, except for the \s-1API\s0 file system subtrees \f(CW\*(C`/dev/\*(C'\fR, \&\f(CW\*(C`/proc/\*(C'\fR and \f(CW\*(C`/sys/\*(C'\fR (protect these directories using \&\f(CW\*(C`PrivateDevices\*(C'\fR, \f(CW\*(C`ProtectKernelTunables\*(C'\fR, \&\f(CW\*(C`ProtectControlGroups\*(C'\fR). This setting ensures that any modification of the vendor-supplied operating system (and optionally its configuration, and local mounts) is prohibited for the service. It is recommended to enable this setting for all long-running services, unless they are involved with system updates or need to modify the operating system in other ways. If this option is used, \&\f(CW\*(C`ReadWritePaths\*(C'\fR may be used to exclude specific directories from being made read-only. This setting is implied if \f(CW\*(C`DynamicUser\*(C'\fR is set. This setting cannot ensure protection in all cases. In general it has the same limitations as \f(CW\*(C`ReadOnlyPaths\*(C'\fR, see below. Defaults to off. \fI Optional. Type enum. choice: 'no', 'yes', 'full', 'strict'. \fR .SS "ProtectHome" .IX Subsection "ProtectHome" Takes a boolean argument or the special values \f(CW\*(C`read\-only\*(C'\fR or \&\f(CW\*(C`tmpfs\*(C'\fR. If true, the directories \f(CW\*(C`/home/\*(C'\fR, \&\f(CW\*(C`/root\*(C'\fR, and \f(CW\*(C`/run/user\*(C'\fR are made inaccessible and empty for processes invoked by this unit. If set to \f(CW\*(C`read\-only\*(C'\fR, the three directories are made read-only instead. If set to \f(CW\*(C`tmpfs\*(C'\fR, temporary file systems are mounted on the three directories in read-only mode. The value \f(CW\*(C`tmpfs\*(C'\fR is useful to hide home directories not relevant to the processes invoked by the unit, while still allowing necessary directories to be made visible when listed in \f(CW\*(C`BindPaths\*(C'\fR or \&\f(CW\*(C`BindReadOnlyPaths\*(C'\fR. .PP Setting this to \f(CW\*(C`yes\*(C'\fR is mostly equivalent to set the three directories in \&\f(CW\*(C`InaccessiblePaths\*(C'\fR. Similarly, \f(CW\*(C`read\-only\*(C'\fR is mostly equivalent to \&\f(CW\*(C`ReadOnlyPaths\*(C'\fR, and \f(CW\*(C`tmpfs\*(C'\fR is mostly equivalent to \&\f(CW\*(C`TemporaryFileSystem\*(C'\fR with \f(CW\*(C`:ro\*(C'\fR. .PP It is recommended to enable this setting for all long-running services (in particular network-facing ones), to ensure they cannot get access to private user data, unless the services actually require access to the user's private data. This setting is implied if \&\f(CW\*(C`DynamicUser\*(C'\fR is set. This setting cannot ensure protection in all cases. In general it has the same limitations as \f(CW\*(C`ReadOnlyPaths\*(C'\fR, see below. \fI Optional. Type enum. choice: 'no', 'yes', 'read\-only', 'tmpfs'. \fR .SS "RuntimeDirectory" .IX Subsection "RuntimeDirectory" These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include \f(CW\*(C`..\*(C'\fR. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (\f(CW\*(C`:\*(C'\fR). .PP In case of \f(CW\*(C`RuntimeDirectory\*(C'\fR the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if \&\f(CW\*(C`RuntimeDirectoryPreserve\*(C'\fR is configured to \f(CW\*(C`restart\*(C'\fR or \&\f(CW\*(C`yes\*(C'\fR (see below). The directories specified with \f(CW\*(C`StateDirectory\*(C'\fR, \&\f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR are not removed when the unit is stopped. .PP Except in case of \f(CW\*(C`ConfigurationDirectory\*(C'\fR, the innermost specified directories will be owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in \f(CW\*(C`RuntimeDirectoryMode\*(C'\fR, \f(CW\*(C`StateDirectoryMode\*(C'\fR, \&\f(CW\*(C`CacheDirectoryMode\*(C'\fR, \f(CW\*(C`LogsDirectoryMode\*(C'\fR and \&\f(CW\*(C`ConfigurationDirectoryMode\*(C'\fR. .PP These options imply \f(CW\*(C`BindPaths\*(C'\fR for the specified paths. When combined with \&\f(CW\*(C`RootDirectory\*(C'\fR or \f(CW\*(C`RootImage\*(C'\fR these paths always reside on the host and are mounted from there into the unit's file system namespace. .PP If \f(CW\*(C`DynamicUser\*(C'\fR is used in conjunction with \&\f(CW\*(C`StateDirectory\*(C'\fR, the logic for \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR is slightly altered: the directories are created below \&\f(CW\*(C`/var/lib/private\*(C'\fR, \f(CW\*(C`/var/cache/private\*(C'\fR and \&\f(CW\*(C`/var/log/private\*(C'\fR, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user \s-1ID\s0 recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below \f(CW\*(C`/var/lib\*(C'\fR, \f(CW\*(C`/var/cache\*(C'\fR and \&\f(CW\*(C`/var/log\*(C'\fR. .PP Use \f(CW\*(C`RuntimeDirectory\*(C'\fR to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in \f(CW\*(C`/run/\*(C'\fR due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using \&\fBtmpfiles.d\fR\|(5). .PP The directories defined by these options are always created under the standard paths used by systemd (\f(CW\*(C`/var/\*(C'\fR, \f(CW\*(C`/run/\*(C'\fR, \f(CW\*(C`/etc/\*(C'\fR, X). If the service needs directories in a different location, a different mechanism has to be used to create them. .PP \&\fBtmpfiles.d\fR\|(5) provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the \&\f(CW\*(C`tmpfiles.d\*(C'\fR configuration is executed before the unit is started. .PP To remove any of the directories created by these settings, use the systemctl clean X command on the relevant units, see \&\fBsystemctl\fR\|(1) for details. .PP Example: if a system service unit has the following, .PP .Vb 1 \& RuntimeDirectory=foo/bar baz .Ve .PP the service manager creates \f(CW\*(C`/run/foo\*(C'\fR (if it does not exist), \&\f(CW\*(C`/run/foo/bar\*(C'\fR, and \f(CW\*(C`/run/baz\*(C'\fR. The directories \f(CW\*(C`/run/foo/bar\*(C'\fR and \&\f(CW\*(C`/run/baz\*(C'\fR except \f(CW\*(C`/run/foo\*(C'\fR are owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR, and removed when the service is stopped. .PP Example: if a system service unit has the following, .PP .Vb 2 \& RuntimeDirectory=foo/bar \& StateDirectory=aaa/bbb ccc .Ve .PP then the environment variable \f(CW\*(C`RUNTIME_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/run/foo/bar\*(C'\fR, and \&\f(CW\*(C`STATE_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/var/lib/aaa/bbb:/var/lib/ccc\*(C'\fR. \fI Optional. Type uniline. \fR .SS "StateDirectory" .IX Subsection "StateDirectory" These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include \f(CW\*(C`..\*(C'\fR. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (\f(CW\*(C`:\*(C'\fR). .PP In case of \f(CW\*(C`RuntimeDirectory\*(C'\fR the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if \&\f(CW\*(C`RuntimeDirectoryPreserve\*(C'\fR is configured to \f(CW\*(C`restart\*(C'\fR or \&\f(CW\*(C`yes\*(C'\fR (see below). The directories specified with \f(CW\*(C`StateDirectory\*(C'\fR, \&\f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR are not removed when the unit is stopped. .PP Except in case of \f(CW\*(C`ConfigurationDirectory\*(C'\fR, the innermost specified directories will be owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in \f(CW\*(C`RuntimeDirectoryMode\*(C'\fR, \f(CW\*(C`StateDirectoryMode\*(C'\fR, \&\f(CW\*(C`CacheDirectoryMode\*(C'\fR, \f(CW\*(C`LogsDirectoryMode\*(C'\fR and \&\f(CW\*(C`ConfigurationDirectoryMode\*(C'\fR. .PP These options imply \f(CW\*(C`BindPaths\*(C'\fR for the specified paths. When combined with \&\f(CW\*(C`RootDirectory\*(C'\fR or \f(CW\*(C`RootImage\*(C'\fR these paths always reside on the host and are mounted from there into the unit's file system namespace. .PP If \f(CW\*(C`DynamicUser\*(C'\fR is used in conjunction with \&\f(CW\*(C`StateDirectory\*(C'\fR, the logic for \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR is slightly altered: the directories are created below \&\f(CW\*(C`/var/lib/private\*(C'\fR, \f(CW\*(C`/var/cache/private\*(C'\fR and \&\f(CW\*(C`/var/log/private\*(C'\fR, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user \s-1ID\s0 recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below \f(CW\*(C`/var/lib\*(C'\fR, \f(CW\*(C`/var/cache\*(C'\fR and \&\f(CW\*(C`/var/log\*(C'\fR. .PP Use \f(CW\*(C`RuntimeDirectory\*(C'\fR to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in \f(CW\*(C`/run/\*(C'\fR due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using \&\fBtmpfiles.d\fR\|(5). .PP The directories defined by these options are always created under the standard paths used by systemd (\f(CW\*(C`/var/\*(C'\fR, \f(CW\*(C`/run/\*(C'\fR, \f(CW\*(C`/etc/\*(C'\fR, X). If the service needs directories in a different location, a different mechanism has to be used to create them. .PP \&\fBtmpfiles.d\fR\|(5) provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the \&\f(CW\*(C`tmpfiles.d\*(C'\fR configuration is executed before the unit is started. .PP To remove any of the directories created by these settings, use the systemctl clean X command on the relevant units, see \&\fBsystemctl\fR\|(1) for details. .PP Example: if a system service unit has the following, .PP .Vb 1 \& RuntimeDirectory=foo/bar baz .Ve .PP the service manager creates \f(CW\*(C`/run/foo\*(C'\fR (if it does not exist), \&\f(CW\*(C`/run/foo/bar\*(C'\fR, and \f(CW\*(C`/run/baz\*(C'\fR. The directories \f(CW\*(C`/run/foo/bar\*(C'\fR and \&\f(CW\*(C`/run/baz\*(C'\fR except \f(CW\*(C`/run/foo\*(C'\fR are owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR, and removed when the service is stopped. .PP Example: if a system service unit has the following, .PP .Vb 2 \& RuntimeDirectory=foo/bar \& StateDirectory=aaa/bbb ccc .Ve .PP then the environment variable \f(CW\*(C`RUNTIME_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/run/foo/bar\*(C'\fR, and \&\f(CW\*(C`STATE_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/var/lib/aaa/bbb:/var/lib/ccc\*(C'\fR. \fI Optional. Type uniline. \fR .SS "CacheDirectory" .IX Subsection "CacheDirectory" These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include \f(CW\*(C`..\*(C'\fR. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (\f(CW\*(C`:\*(C'\fR). .PP In case of \f(CW\*(C`RuntimeDirectory\*(C'\fR the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if \&\f(CW\*(C`RuntimeDirectoryPreserve\*(C'\fR is configured to \f(CW\*(C`restart\*(C'\fR or \&\f(CW\*(C`yes\*(C'\fR (see below). The directories specified with \f(CW\*(C`StateDirectory\*(C'\fR, \&\f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR are not removed when the unit is stopped. .PP Except in case of \f(CW\*(C`ConfigurationDirectory\*(C'\fR, the innermost specified directories will be owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in \f(CW\*(C`RuntimeDirectoryMode\*(C'\fR, \f(CW\*(C`StateDirectoryMode\*(C'\fR, \&\f(CW\*(C`CacheDirectoryMode\*(C'\fR, \f(CW\*(C`LogsDirectoryMode\*(C'\fR and \&\f(CW\*(C`ConfigurationDirectoryMode\*(C'\fR. .PP These options imply \f(CW\*(C`BindPaths\*(C'\fR for the specified paths. When combined with \&\f(CW\*(C`RootDirectory\*(C'\fR or \f(CW\*(C`RootImage\*(C'\fR these paths always reside on the host and are mounted from there into the unit's file system namespace. .PP If \f(CW\*(C`DynamicUser\*(C'\fR is used in conjunction with \&\f(CW\*(C`StateDirectory\*(C'\fR, the logic for \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR is slightly altered: the directories are created below \&\f(CW\*(C`/var/lib/private\*(C'\fR, \f(CW\*(C`/var/cache/private\*(C'\fR and \&\f(CW\*(C`/var/log/private\*(C'\fR, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user \s-1ID\s0 recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below \f(CW\*(C`/var/lib\*(C'\fR, \f(CW\*(C`/var/cache\*(C'\fR and \&\f(CW\*(C`/var/log\*(C'\fR. .PP Use \f(CW\*(C`RuntimeDirectory\*(C'\fR to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in \f(CW\*(C`/run/\*(C'\fR due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using \&\fBtmpfiles.d\fR\|(5). .PP The directories defined by these options are always created under the standard paths used by systemd (\f(CW\*(C`/var/\*(C'\fR, \f(CW\*(C`/run/\*(C'\fR, \f(CW\*(C`/etc/\*(C'\fR, X). If the service needs directories in a different location, a different mechanism has to be used to create them. .PP \&\fBtmpfiles.d\fR\|(5) provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the \&\f(CW\*(C`tmpfiles.d\*(C'\fR configuration is executed before the unit is started. .PP To remove any of the directories created by these settings, use the systemctl clean X command on the relevant units, see \&\fBsystemctl\fR\|(1) for details. .PP Example: if a system service unit has the following, .PP .Vb 1 \& RuntimeDirectory=foo/bar baz .Ve .PP the service manager creates \f(CW\*(C`/run/foo\*(C'\fR (if it does not exist), \&\f(CW\*(C`/run/foo/bar\*(C'\fR, and \f(CW\*(C`/run/baz\*(C'\fR. The directories \f(CW\*(C`/run/foo/bar\*(C'\fR and \&\f(CW\*(C`/run/baz\*(C'\fR except \f(CW\*(C`/run/foo\*(C'\fR are owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR, and removed when the service is stopped. .PP Example: if a system service unit has the following, .PP .Vb 2 \& RuntimeDirectory=foo/bar \& StateDirectory=aaa/bbb ccc .Ve .PP then the environment variable \f(CW\*(C`RUNTIME_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/run/foo/bar\*(C'\fR, and \&\f(CW\*(C`STATE_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/var/lib/aaa/bbb:/var/lib/ccc\*(C'\fR. \fI Optional. Type uniline. \fR .SS "LogsDirectory" .IX Subsection "LogsDirectory" These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include \f(CW\*(C`..\*(C'\fR. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (\f(CW\*(C`:\*(C'\fR). .PP In case of \f(CW\*(C`RuntimeDirectory\*(C'\fR the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if \&\f(CW\*(C`RuntimeDirectoryPreserve\*(C'\fR is configured to \f(CW\*(C`restart\*(C'\fR or \&\f(CW\*(C`yes\*(C'\fR (see below). The directories specified with \f(CW\*(C`StateDirectory\*(C'\fR, \&\f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR are not removed when the unit is stopped. .PP Except in case of \f(CW\*(C`ConfigurationDirectory\*(C'\fR, the innermost specified directories will be owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in \f(CW\*(C`RuntimeDirectoryMode\*(C'\fR, \f(CW\*(C`StateDirectoryMode\*(C'\fR, \&\f(CW\*(C`CacheDirectoryMode\*(C'\fR, \f(CW\*(C`LogsDirectoryMode\*(C'\fR and \&\f(CW\*(C`ConfigurationDirectoryMode\*(C'\fR. .PP These options imply \f(CW\*(C`BindPaths\*(C'\fR for the specified paths. When combined with \&\f(CW\*(C`RootDirectory\*(C'\fR or \f(CW\*(C`RootImage\*(C'\fR these paths always reside on the host and are mounted from there into the unit's file system namespace. .PP If \f(CW\*(C`DynamicUser\*(C'\fR is used in conjunction with \&\f(CW\*(C`StateDirectory\*(C'\fR, the logic for \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR is slightly altered: the directories are created below \&\f(CW\*(C`/var/lib/private\*(C'\fR, \f(CW\*(C`/var/cache/private\*(C'\fR and \&\f(CW\*(C`/var/log/private\*(C'\fR, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user \s-1ID\s0 recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below \f(CW\*(C`/var/lib\*(C'\fR, \f(CW\*(C`/var/cache\*(C'\fR and \&\f(CW\*(C`/var/log\*(C'\fR. .PP Use \f(CW\*(C`RuntimeDirectory\*(C'\fR to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in \f(CW\*(C`/run/\*(C'\fR due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using \&\fBtmpfiles.d\fR\|(5). .PP The directories defined by these options are always created under the standard paths used by systemd (\f(CW\*(C`/var/\*(C'\fR, \f(CW\*(C`/run/\*(C'\fR, \f(CW\*(C`/etc/\*(C'\fR, X). If the service needs directories in a different location, a different mechanism has to be used to create them. .PP \&\fBtmpfiles.d\fR\|(5) provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the \&\f(CW\*(C`tmpfiles.d\*(C'\fR configuration is executed before the unit is started. .PP To remove any of the directories created by these settings, use the systemctl clean X command on the relevant units, see \&\fBsystemctl\fR\|(1) for details. .PP Example: if a system service unit has the following, .PP .Vb 1 \& RuntimeDirectory=foo/bar baz .Ve .PP the service manager creates \f(CW\*(C`/run/foo\*(C'\fR (if it does not exist), \&\f(CW\*(C`/run/foo/bar\*(C'\fR, and \f(CW\*(C`/run/baz\*(C'\fR. The directories \f(CW\*(C`/run/foo/bar\*(C'\fR and \&\f(CW\*(C`/run/baz\*(C'\fR except \f(CW\*(C`/run/foo\*(C'\fR are owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR, and removed when the service is stopped. .PP Example: if a system service unit has the following, .PP .Vb 2 \& RuntimeDirectory=foo/bar \& StateDirectory=aaa/bbb ccc .Ve .PP then the environment variable \f(CW\*(C`RUNTIME_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/run/foo/bar\*(C'\fR, and \&\f(CW\*(C`STATE_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/var/lib/aaa/bbb:/var/lib/ccc\*(C'\fR. \fI Optional. Type uniline. \fR .SS "ConfigurationDirectory" .IX Subsection "ConfigurationDirectory" These options take a whitespace-separated list of directory names. The specified directory names must be relative, and may not include \f(CW\*(C`..\*(C'\fR. If set, when the unit is started, one or more directories by the specified names will be created (including their parents) below the locations defined in the following table. Also, the corresponding environment variable will be defined with the full paths of the directories. If multiple directories are set, then in the environment variable the paths are concatenated with colon (\f(CW\*(C`:\*(C'\fR). .PP In case of \f(CW\*(C`RuntimeDirectory\*(C'\fR the innermost subdirectories are removed when the unit is stopped. It is possible to preserve the specified directories in this case if \&\f(CW\*(C`RuntimeDirectoryPreserve\*(C'\fR is configured to \f(CW\*(C`restart\*(C'\fR or \&\f(CW\*(C`yes\*(C'\fR (see below). The directories specified with \f(CW\*(C`StateDirectory\*(C'\fR, \&\f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR are not removed when the unit is stopped. .PP Except in case of \f(CW\*(C`ConfigurationDirectory\*(C'\fR, the innermost specified directories will be owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR. If the specified directories already exist and their owning user or group do not match the configured ones, all files and directories below the specified directories as well as the directories themselves will have their file ownership recursively changed to match what is configured. As an optimization, if the specified directories are already owned by the right user and group, files and directories below of them are left as-is, even if they do not match what is requested. The innermost specified directories will have their access mode adjusted to the what is specified in \f(CW\*(C`RuntimeDirectoryMode\*(C'\fR, \f(CW\*(C`StateDirectoryMode\*(C'\fR, \&\f(CW\*(C`CacheDirectoryMode\*(C'\fR, \f(CW\*(C`LogsDirectoryMode\*(C'\fR and \&\f(CW\*(C`ConfigurationDirectoryMode\*(C'\fR. .PP These options imply \f(CW\*(C`BindPaths\*(C'\fR for the specified paths. When combined with \&\f(CW\*(C`RootDirectory\*(C'\fR or \f(CW\*(C`RootImage\*(C'\fR these paths always reside on the host and are mounted from there into the unit's file system namespace. .PP If \f(CW\*(C`DynamicUser\*(C'\fR is used in conjunction with \&\f(CW\*(C`StateDirectory\*(C'\fR, the logic for \f(CW\*(C`CacheDirectory\*(C'\fR and \&\f(CW\*(C`LogsDirectory\*(C'\fR is slightly altered: the directories are created below \&\f(CW\*(C`/var/lib/private\*(C'\fR, \f(CW\*(C`/var/cache/private\*(C'\fR and \&\f(CW\*(C`/var/log/private\*(C'\fR, respectively, which are host directories made inaccessible to unprivileged users, which ensures that access to these directories cannot be gained through dynamic user \s-1ID\s0 recycling. Symbolic links are created to hide this difference in behaviour. Both from perspective of the host and from inside the unit, the relevant directories hence always appear directly below \f(CW\*(C`/var/lib\*(C'\fR, \f(CW\*(C`/var/cache\*(C'\fR and \&\f(CW\*(C`/var/log\*(C'\fR. .PP Use \f(CW\*(C`RuntimeDirectory\*(C'\fR to manage one or more runtime directories for the unit and bind their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create runtime directories in \f(CW\*(C`/run/\*(C'\fR due to lack of privileges, and to make sure the runtime directory is cleaned up automatically after use. For runtime directories that require more complex or different configuration or lifetime guarantees, please consider using \&\fBtmpfiles.d\fR\|(5). .PP The directories defined by these options are always created under the standard paths used by systemd (\f(CW\*(C`/var/\*(C'\fR, \f(CW\*(C`/run/\*(C'\fR, \f(CW\*(C`/etc/\*(C'\fR, X). If the service needs directories in a different location, a different mechanism has to be used to create them. .PP \&\fBtmpfiles.d\fR\|(5) provides functionality that overlaps with these options. Using these options is recommended, because the lifetime of the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the \&\f(CW\*(C`tmpfiles.d\*(C'\fR configuration is executed before the unit is started. .PP To remove any of the directories created by these settings, use the systemctl clean X command on the relevant units, see \&\fBsystemctl\fR\|(1) for details. .PP Example: if a system service unit has the following, .PP .Vb 1 \& RuntimeDirectory=foo/bar baz .Ve .PP the service manager creates \f(CW\*(C`/run/foo\*(C'\fR (if it does not exist), \&\f(CW\*(C`/run/foo/bar\*(C'\fR, and \f(CW\*(C`/run/baz\*(C'\fR. The directories \f(CW\*(C`/run/foo/bar\*(C'\fR and \&\f(CW\*(C`/run/baz\*(C'\fR except \f(CW\*(C`/run/foo\*(C'\fR are owned by the user and group specified in \f(CW\*(C`User\*(C'\fR and \f(CW\*(C`Group\*(C'\fR, and removed when the service is stopped. .PP Example: if a system service unit has the following, .PP .Vb 2 \& RuntimeDirectory=foo/bar \& StateDirectory=aaa/bbb ccc .Ve .PP then the environment variable \f(CW\*(C`RUNTIME_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/run/foo/bar\*(C'\fR, and \&\f(CW\*(C`STATE_DIRECTORY\*(C'\fR is set with \f(CW\*(C`/var/lib/aaa/bbb:/var/lib/ccc\*(C'\fR. \fI Optional. Type uniline. \fR .SS "RuntimeDirectoryMode" .IX Subsection "RuntimeDirectoryMode" Specifies the access mode of the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR, \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, or \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR, respectively, as an octal number. Defaults to \&\f(CW0755\fR. See \*(L"Permissions\*(R" in \fBpath_resolution\fR\|(7) for a discussion of the meaning of permission bits. \fI Optional. Type uniline. \fR .SS "StateDirectoryMode" .IX Subsection "StateDirectoryMode" Specifies the access mode of the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR, \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, or \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR, respectively, as an octal number. Defaults to \&\f(CW0755\fR. See \*(L"Permissions\*(R" in \fBpath_resolution\fR\|(7) for a discussion of the meaning of permission bits. \fI Optional. Type uniline. \fR .SS "CacheDirectoryMode" .IX Subsection "CacheDirectoryMode" Specifies the access mode of the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR, \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, or \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR, respectively, as an octal number. Defaults to \&\f(CW0755\fR. See \*(L"Permissions\*(R" in \fBpath_resolution\fR\|(7) for a discussion of the meaning of permission bits. \fI Optional. Type uniline. \fR .SS "LogsDirectoryMode" .IX Subsection "LogsDirectoryMode" Specifies the access mode of the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR, \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, or \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR, respectively, as an octal number. Defaults to \&\f(CW0755\fR. See \*(L"Permissions\*(R" in \fBpath_resolution\fR\|(7) for a discussion of the meaning of permission bits. \fI Optional. Type uniline. \fR .SS "ConfigurationDirectoryMode" .IX Subsection "ConfigurationDirectoryMode" Specifies the access mode of the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR, \&\f(CW\*(C`StateDirectory\*(C'\fR, \f(CW\*(C`CacheDirectory\*(C'\fR, \f(CW\*(C`LogsDirectory\*(C'\fR, or \&\f(CW\*(C`ConfigurationDirectory\*(C'\fR, respectively, as an octal number. Defaults to \&\f(CW0755\fR. See \*(L"Permissions\*(R" in \fBpath_resolution\fR\|(7) for a discussion of the meaning of permission bits. \fI Optional. Type uniline. \fR .SS "RuntimeDirectoryPreserve" .IX Subsection "RuntimeDirectoryPreserve" Takes a boolean argument or \f(CW\*(C`restart\*(C'\fR. If set to \f(CW\*(C`no\*(C'\fR (the default), the directories specified in \f(CW\*(C`RuntimeDirectory\*(C'\fR are always removed when the service stops. If set to \f(CW\*(C`restart\*(C'\fR the directories are preserved when the service is both automatically and manually restarted. Here, the automatic restart means the operation specified in \&\f(CW\*(C`Restart\*(C'\fR, and manual restart means the one triggered by systemctl restart foo.service. If set to \f(CW\*(C`yes\*(C'\fR, then the directories are not removed when the service is stopped. Note that since the runtime directory \f(CW\*(C`/run/\*(C'\fR is a mount point of \&\f(CW\*(C`tmpfs\*(C'\fR, then for system services the directories specified in \&\f(CW\*(C`RuntimeDirectory\*(C'\fR are removed when the system is rebooted. \fI Optional. Type enum. choice: 'no', 'yes', 'restart'. \fR .SS "TimeoutCleanSec" .IX Subsection "TimeoutCleanSec" Configures a timeout on the clean-up operation requested through systemctl clean X, see \&\fBsystemctl\fR\|(1) for details. Takes the usual time values and defaults to \f(CW\*(C`infinity\*(C'\fR, i.e. by default no timeout is applied. If a timeout is configured the clean operation will be aborted forcibly when the timeout is reached, potentially leaving resources on disk. \fI Optional. Type uniline. \fR .SS "ReadWritePaths" .IX Subsection "ReadWritePaths" Sets up a new file system namespace for executed processes. These options may be used to limit access a process has to the file system. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with \&\f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR. .PP Paths listed in \f(CW\*(C`ReadWritePaths\*(C'\fR are accessible from within the namespace with the same access modes as from outside of it. Paths listed in \f(CW\*(C`ReadOnlyPaths\*(C'\fR are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest \f(CW\*(C`ReadWritePaths\*(C'\fR inside of \f(CW\*(C`ReadOnlyPaths\*(C'\fR in order to provide writable subdirectories within read-only directories. Use \&\f(CW\*(C`ReadWritePaths\*(C'\fR in order to allow-list specific paths for write access if \&\f(CW\*(C`ProtectSystem=strict\*(C'\fR is used. .PP Paths listed in \f(CW\*(C`InaccessiblePaths\*(C'\fR will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR, \&\f(CW\*(C`BindPaths\*(C'\fR, or \f(CW\*(C`BindReadOnlyPaths\*(C'\fR inside it. For a more flexible option, see \f(CW\*(C`TemporaryFileSystem\*(C'\fR. .PP Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. .PP Paths in \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR and \&\f(CW\*(C`InaccessiblePaths\*(C'\fR may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case they will be ignored when they do not exist. If prefixed with \f(CW\*(C`+\*(C'\fR the paths are taken relative to the root directory of the unit, as configured with \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR, instead of relative to the root directory of the host (see above). When combining \f(CW\*(C`\-\*(C'\fR and \&\f(CW\*(C`+\*(C'\fR on the same path make sure to specify \f(CW\*(C`\-\*(C'\fR first, and \f(CW\*(C`+\*(C'\fR second. .PP Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For \f(CW\*(C`ReadWritePaths\*(C'\fR and \f(CW\*(C`ReadOnlyPaths\*(C'\fR propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with \f(CW\*(C`ReadOnlyPaths\*(C'\fR! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. .PP Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either \&\f(CW\*(C`CapabilityBoundingSet=~CAP_SYS_ADMIN\*(C'\fR or \&\f(CW\*(C`SystemCallFilter=~@mount\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "ReadOnlyPaths" .IX Subsection "ReadOnlyPaths" Sets up a new file system namespace for executed processes. These options may be used to limit access a process has to the file system. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with \&\f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR. .PP Paths listed in \f(CW\*(C`ReadWritePaths\*(C'\fR are accessible from within the namespace with the same access modes as from outside of it. Paths listed in \f(CW\*(C`ReadOnlyPaths\*(C'\fR are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest \f(CW\*(C`ReadWritePaths\*(C'\fR inside of \f(CW\*(C`ReadOnlyPaths\*(C'\fR in order to provide writable subdirectories within read-only directories. Use \&\f(CW\*(C`ReadWritePaths\*(C'\fR in order to allow-list specific paths for write access if \&\f(CW\*(C`ProtectSystem=strict\*(C'\fR is used. .PP Paths listed in \f(CW\*(C`InaccessiblePaths\*(C'\fR will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR, \&\f(CW\*(C`BindPaths\*(C'\fR, or \f(CW\*(C`BindReadOnlyPaths\*(C'\fR inside it. For a more flexible option, see \f(CW\*(C`TemporaryFileSystem\*(C'\fR. .PP Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. .PP Paths in \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR and \&\f(CW\*(C`InaccessiblePaths\*(C'\fR may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case they will be ignored when they do not exist. If prefixed with \f(CW\*(C`+\*(C'\fR the paths are taken relative to the root directory of the unit, as configured with \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR, instead of relative to the root directory of the host (see above). When combining \f(CW\*(C`\-\*(C'\fR and \&\f(CW\*(C`+\*(C'\fR on the same path make sure to specify \f(CW\*(C`\-\*(C'\fR first, and \f(CW\*(C`+\*(C'\fR second. .PP Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For \f(CW\*(C`ReadWritePaths\*(C'\fR and \f(CW\*(C`ReadOnlyPaths\*(C'\fR propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with \f(CW\*(C`ReadOnlyPaths\*(C'\fR! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. .PP Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either \&\f(CW\*(C`CapabilityBoundingSet=~CAP_SYS_ADMIN\*(C'\fR or \&\f(CW\*(C`SystemCallFilter=~@mount\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "InaccessiblePaths" .IX Subsection "InaccessiblePaths" Sets up a new file system namespace for executed processes. These options may be used to limit access a process has to the file system. Each setting takes a space-separated list of paths relative to the host's root directory (i.e. the system running the service manager). Note that if paths contain symlinks, they are resolved relative to the root directory set with \&\f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR. .PP Paths listed in \f(CW\*(C`ReadWritePaths\*(C'\fR are accessible from within the namespace with the same access modes as from outside of it. Paths listed in \f(CW\*(C`ReadOnlyPaths\*(C'\fR are accessible for reading only, writing will be refused even if the usual file access controls would permit this. Nest \f(CW\*(C`ReadWritePaths\*(C'\fR inside of \f(CW\*(C`ReadOnlyPaths\*(C'\fR in order to provide writable subdirectories within read-only directories. Use \&\f(CW\*(C`ReadWritePaths\*(C'\fR in order to allow-list specific paths for write access if \&\f(CW\*(C`ProtectSystem=strict\*(C'\fR is used. .PP Paths listed in \f(CW\*(C`InaccessiblePaths\*(C'\fR will be made inaccessible for processes inside the namespace along with everything below them in the file system hierarchy. This may be more restrictive than desired, because it is not possible to nest \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR, \&\f(CW\*(C`BindPaths\*(C'\fR, or \f(CW\*(C`BindReadOnlyPaths\*(C'\fR inside it. For a more flexible option, see \f(CW\*(C`TemporaryFileSystem\*(C'\fR. .PP Non-directory paths may be specified as well. These options may be specified more than once, in which case all paths listed will have limited access from within the namespace. If the empty string is assigned to this option, the specific list is reset, and all prior assignments have no effect. .PP Paths in \f(CW\*(C`ReadWritePaths\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR and \&\f(CW\*(C`InaccessiblePaths\*(C'\fR may be prefixed with \f(CW\*(C`\-\*(C'\fR, in which case they will be ignored when they do not exist. If prefixed with \f(CW\*(C`+\*(C'\fR the paths are taken relative to the root directory of the unit, as configured with \f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR, instead of relative to the root directory of the host (see above). When combining \f(CW\*(C`\-\*(C'\fR and \&\f(CW\*(C`+\*(C'\fR on the same path make sure to specify \f(CW\*(C`\-\*(C'\fR first, and \f(CW\*(C`+\*(C'\fR second. .PP Note that these settings will disconnect propagation of mounts from the unit's processes to the host. This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. For \f(CW\*(C`ReadWritePaths\*(C'\fR and \f(CW\*(C`ReadOnlyPaths\*(C'\fR propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace, i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated below a path marked with \f(CW\*(C`ReadOnlyPaths\*(C'\fR! Restricting access with these options hence does not extend to submounts of a directory that are created later on. This means the lock-down offered by that setting is not complete, and does not offer full protection. .PP Note that the effect of these settings may be undone by privileged processes. In order to set up an effective sandboxed environment for a unit it is thus recommended to combine these settings with either \&\f(CW\*(C`CapabilityBoundingSet=~CAP_SYS_ADMIN\*(C'\fR or \&\f(CW\*(C`SystemCallFilter=~@mount\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "TemporaryFileSystem" .IX Subsection "TemporaryFileSystem" Takes a space-separated list of mount points for temporary file systems (tmpfs). If set, a new file system namespace is set up for executed processes, and a temporary file system is mounted on each mount point. This option may be specified more than once, in which case temporary file systems are mounted on all listed mount points. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect. Each mount point may optionally be suffixed with a colon (\f(CW\*(C`:\*(C'\fR) and mount options such as \&\f(CW\*(C`size=10%\*(C'\fR or \f(CW\*(C`ro\*(C'\fR. By default, each temporary file system is mounted with \f(CW\*(C`nodev,strictatime,mode=0755\*(C'\fR. These can be disabled by explicitly specifying the corresponding mount options, e.g., \f(CW\*(C`dev\*(C'\fR or \f(CW\*(C`nostrictatime\*(C'\fR. .PP This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary files or directories can be still accessed by combining with \f(CW\*(C`BindPaths\*(C'\fR or \&\f(CW\*(C`BindReadOnlyPaths\*(C'\fR: .PP Example: if a unit has the following, .PP .Vb 2 \& TemporaryFileSystem=/var:ro \& BindReadOnlyPaths=/var/lib/systemd .Ve .PP then the invoked processes by the unit cannot see any files or directories under \f(CW\*(C`/var/\*(C'\fR except for \&\f(CW\*(C`/var/lib/systemd\*(C'\fR or its contents. \fI Optional. Type list of uniline. \fR .SS "PrivateTmp" .IX Subsection "PrivateTmp" Takes a boolean argument. If true, sets up a new file system namespace for the executed processes and mounts private \f(CW\*(C`/tmp/\*(C'\fR and \f(CW\*(C`/var/tmp/\*(C'\fR directories inside it that are not shared by processes outside of the namespace. This is useful to secure access to temporary files of the process, but makes sharing between processes via \&\f(CW\*(C`/tmp/\*(C'\fR or \f(CW\*(C`/var/tmp/\*(C'\fR impossible. If this is enabled, all temporary files created by a service in these directories will be removed after the service is stopped. Defaults to false. It is possible to run two or more units within the same private \&\f(CW\*(C`/tmp/\*(C'\fR and \f(CW\*(C`/var/tmp/\*(C'\fR namespace by using the \&\f(CW\*(C`JoinsNamespaceOf\*(C'\fR directive, see \&\fBsystemd.unit\fR\|(5) for details. This setting is implied if \f(CW\*(C`DynamicUser\*(C'\fR is set. For this setting the same restrictions regarding mount propagation and privileges apply as for \&\f(CW\*(C`ReadOnlyPaths\*(C'\fR and related calls, see above. Enabling this setting has the side effect of adding \f(CW\*(C`Requires\*(C'\fR and \f(CW\*(C`After\*(C'\fR dependencies on all mount units necessary to access \f(CW\*(C`/tmp/\*(C'\fR and \f(CW\*(C`/var/tmp/\*(C'\fR. Moreover an implicitly \f(CW\*(C`After\*(C'\fR ordering on \&\fBsystemd\-tmpfiles\-setup.service\fR\|(8) is added. .PP Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. \fI Optional. Type boolean. \fR .SS "PrivateDevices" .IX Subsection "PrivateDevices" Takes a boolean argument. If true, sets up a new \f(CW\*(C`/dev/\*(C'\fR mount for the executed processes and only adds \s-1API\s0 pseudo devices such as \f(CW\*(C`/dev/null\*(C'\fR, \&\f(CW\*(C`/dev/zero\*(C'\fR or \f(CW\*(C`/dev/random\*(C'\fR (as well as the pseudo \s-1TTY\s0 subsystem) to it, but no physical devices such as \f(CW\*(C`/dev/sda\*(C'\fR, system memory \f(CW\*(C`/dev/mem\*(C'\fR, system ports \f(CW\*(C`/dev/port\*(C'\fR and others. This is useful to securely turn off physical device access by the executed process. Defaults to false. Enabling this option will install a system call filter to block low-level I/O system calls that are grouped in the \f(CW\*(C`@raw\-io\*(C'\fR set, will also remove \&\f(CW\*(C`CAP_MKNOD\*(C'\fR and \f(CW\*(C`CAP_SYS_RAWIO\*(C'\fR from the capability bounding set for the unit (see above), and set \f(CW\*(C`DevicePolicy=closed\*(C'\fR (see \&\fBsystemd.resource\-control\fR\|(5) for details). Note that using this setting will disconnect propagation of mounts from the service to the host (propagation in the opposite direction continues to work). This means that this setting may not be used for services which shall be able to install mount points in the main mount namespace. The new \&\f(CW\*(C`/dev/\*(C'\fR will be mounted read-only and 'noexec'. The latter may break old programs which try to set up executable memory by using \&\fBmmap\fR\|(2) of \&\f(CW\*(C`/dev/zero\*(C'\fR instead of using \f(CW\*(C`MAP_ANON\*(C'\fR. For this setting the same restrictions regarding mount propagation and privileges apply as for \f(CW\*(C`ReadOnlyPaths\*(C'\fR and related calls, see above. If turned on and if running in user mode, or in system mode, but without the \&\f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. .PP Note that the implementation of this setting might be impossible (for example if mount namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. \fI Optional. Type boolean. \fR .SS "PrivateNetwork" .IX Subsection "PrivateNetwork" Takes a boolean argument. If true, sets up a new network namespace for the executed processes and configures only the loopback network device \f(CW\*(C`lo\*(C'\fR inside it. No other network devices will be available to the executed process. This is useful to turn off network access by the executed process. Defaults to false. It is possible to run two or more units within the same private network namespace by using the \f(CW\*(C`JoinsNamespaceOf\*(C'\fR directive, see \&\fBsystemd.unit\fR\|(5) for details. Note that this option will disconnect all socket families from the host, including \&\f(CW\*(C`AF_NETLINK\*(C'\fR and \f(CW\*(C`AF_UNIX\*(C'\fR. Effectively, for \&\f(CW\*(C`AF_NETLINK\*(C'\fR this means that device configuration events received from \&\fBsystemd\-udevd.service\fR\|(8) are not delivered to the unit's processes. And for \f(CW\*(C`AF_UNIX\*(C'\fR this has the effect that \&\f(CW\*(C`AF_UNIX\*(C'\fR sockets in the abstract socket namespace of the host will become unavailable to the unit's processes (however, those located in the file system will continue to be accessible). .PP Note that the implementation of this setting might be impossible (for example if network namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. .PP When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within a private network namespace. This may be combined with \&\f(CW\*(C`JoinsNamespaceOf\*(C'\fR to listen on sockets inside of network namespaces of other services. \fI Optional. Type boolean. \fR .SS "NetworkNamespacePath" .IX Subsection "NetworkNamespacePath" Takes an absolute file system path refererring to a Linux network namespace pseudo-file (i.e. a file like \f(CW\*(C`/proc/$PID/ns/net\*(C'\fR or a bind mount or symlink to one). When set the invoked processes are added to the network namespace referenced by that path. The path has to point to a valid namespace file at the moment the processes are forked off. If this option is used \f(CW\*(C`PrivateNetwork\*(C'\fR has no effect. If this option is used together with \&\f(CW\*(C`JoinsNamespaceOf\*(C'\fR then it only has an effect if this unit is started before any of the listed units that have \f(CW\*(C`PrivateNetwork\*(C'\fR or \&\f(CW\*(C`NetworkNamespacePath\*(C'\fR configured, as otherwise the network namespace of those units is reused. .PP When this option is used on a socket unit any sockets bound on behalf of this unit will be bound within the specified network namespace. \fI Optional. Type uniline. \fR .SS "PrivateUsers" .IX Subsection "PrivateUsers" Takes a boolean argument. If true, sets up a new user namespace for the executed processes and configures a minimal user and group mapping, that maps the \f(CW\*(C`root\*(C'\fR user and group as well as the unit's own user and group to themselves and everything else to the \f(CW\*(C`nobody\*(C'\fR user and group. This is useful to securely detach the user and group databases used by the unit from the rest of the system, and thus to create an effective sandbox environment. All files, directories, processes, \s-1IPC\s0 objects and other resources owned by users/groups not equaling \f(CW\*(C`root\*(C'\fR or the unit's own will stay visible from within the unit but appear owned by the \f(CW\*(C`nobody\*(C'\fR user and group. If this mode is enabled, all unit processes are run without privileges in the host user namespace (regardless if the unit's own user/group is \f(CW\*(C`root\*(C'\fR or not). Specifically this means that the process will have zero process capabilities on the host's user namespace, but full capabilities within the service's user namespace. Settings such as \f(CW\*(C`CapabilityBoundingSet\*(C'\fR will affect only the latter, and there's no way to acquire additional capabilities in the host's user namespace. Defaults to off. .PP When this setting is set up by a per-user instance of the service manager, the mapping of the \&\f(CW\*(C`root\*(C'\fR user and group to itself is omitted (unless the user manager is root). Additionally, in the per-user instance manager case, the user namespace will be set up before most other namespaces. This means that combining \&\f(CW\*(C`PrivateUsers\*(C'\fR\f(CW\*(C`true\*(C'\fR with other namespaces will enable use of features not normally supported by the per-user instances of the service manager. .PP This setting is particularly useful in conjunction with \&\f(CW\*(C`RootDirectory\*(C'\fR/\f(CW\*(C`RootImage\*(C'\fR, as the need to synchronize the user and group databases in the root directory and on the host is reduced, as the only users and groups who need to be matched are \f(CW\*(C`root\*(C'\fR, \f(CW\*(C`nobody\*(C'\fR and the unit's own user and group. .PP Note that the implementation of this setting might be impossible (for example if user namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. \fI Optional. Type boolean. \fR .SS "ProtectHostname" .IX Subsection "ProtectHostname" Takes a boolean argument. When set, sets up a new \s-1UTS\s0 namespace for the executed processes. In addition, changing hostname or domainname is prevented. Defaults to off. .PP Note that the implementation of this setting might be impossible (for example if \s-1UTS\s0 namespaces are not available), and the unit should be written in a way that does not solely rely on this setting for security. .PP Note that when this option is enabled for a service hostname changes no longer propagate from the system into the service, it is hence not suitable for services that need to take notice of system hostname changes dynamically. \fI Optional. Type boolean. \fR .SS "ProtectClock" .IX Subsection "ProtectClock" Takes a boolean argument. If set, writes to the hardware clock or system clock will be denied. It is recommended to turn this on for most services that do not need modify the clock. Defaults to off. Enabling this option removes \f(CW\*(C`CAP_SYS_TIME\*(C'\fR and \f(CW\*(C`CAP_WAKE_ALARM\*(C'\fR from the capability bounding set for this unit, installs a system call filter to block calls that can set the clock, and \f(CW\*(C`DeviceAllow=char\-rtc r\*(C'\fR is implied. This ensures \f(CW\*(C`/dev/rtc0\*(C'\fR, \&\f(CW\*(C`/dev/rtc1\*(C'\fR, etc. are made read-only to the service. See \&\fBsystemd.resource\-control\fR\|(5) for the details about \f(CW\*(C`DeviceAllow\*(C'\fR. \fI Optional. Type boolean. \fR .SS "ProtectKernelTunables" .IX Subsection "ProtectKernelTunables" Takes a boolean argument. If true, kernel variables accessible through \&\f(CW\*(C`/proc/sys/\*(C'\fR, \f(CW\*(C`/sys/\*(C'\fR, \f(CW\*(C`/proc/sysrq\-trigger\*(C'\fR, \&\f(CW\*(C`/proc/latency_stats\*(C'\fR, \f(CW\*(C`/proc/acpi\*(C'\fR, \&\f(CW\*(C`/proc/timer_stats\*(C'\fR, \f(CW\*(C`/proc/fs\*(C'\fR and \f(CW\*(C`/proc/irq\*(C'\fR will be made read-only to all processes of the unit. Usually, tunable kernel variables should be initialized only at boot-time, for example with the \&\fBsysctl.d\fR\|(5) mechanism. Few services need to write to these at runtime; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for \&\f(CW\*(C`ReadOnlyPaths\*(C'\fR and related calls, see above. Defaults to off. If turned on and if running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. services for which \f(CW\*(C`User\*(C'\fR is set), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. Note that this option does not prevent indirect changes to kernel tunables effected by \s-1IPC\s0 calls to other processes. However, \&\f(CW\*(C`InaccessiblePaths\*(C'\fR may be used to make relevant \s-1IPC\s0 file system objects inaccessible. If \&\f(CW\*(C`ProtectKernelTunables\*(C'\fR is set, \f(CW\*(C`MountAPIVFS=yes\*(C'\fR is implied. \fI Optional. Type boolean. \fR .SS "ProtectKernelModules" .IX Subsection "ProtectKernelModules" Takes a boolean argument. If true, explicit module loading will be denied. This allows module load and unload operations to be turned off on modular kernels. It is recommended to turn this on for most services that do not need special file systems or extra kernel modules to work. Defaults to off. Enabling this option removes \f(CW\*(C`CAP_SYS_MODULE\*(C'\fR from the capability bounding set for the unit, and installs a system call filter to block module system calls, also \f(CW\*(C`/usr/lib/modules\*(C'\fR is made inaccessible. For this setting the same restrictions regarding mount propagation and privileges apply as for \&\f(CW\*(C`ReadOnlyPaths\*(C'\fR and related calls, see above. Note that limited automatic module loading due to user configuration or kernel mapping tables might still happen as side effect of requested user operations, both privileged and unprivileged. To disable module auto-load feature please see \&\fBsysctl.d\fR\|(5)\f(CW\*(C`kernel.modules_disabled\*(C'\fR mechanism and \&\f(CW\*(C`/proc/sys/kernel/modules_disabled\*(C'\fR documentation. If turned on and if running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \&\f(CW\*(C`User\*(C'\fR), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. \fI Optional. Type boolean. \fR .SS "ProtectKernelLogs" .IX Subsection "ProtectKernelLogs" Takes a boolean argument. If true, access to the kernel log ring buffer will be denied. It is recommended to turn this on for most services that do not need to read from or write to the kernel log ring buffer. Enabling this option removes \f(CW\*(C`CAP_SYSLOG\*(C'\fR from the capability bounding set for this unit, and installs a system call filter to block the \&\fBsyslog\fR\|(2) system call (not to be confused with the libc \s-1API\s0 \&\fBsyslog\fR\|(3) for userspace logging). The kernel exposes its log buffer to userspace via \f(CW\*(C`/dev/kmsg\*(C'\fR and \&\f(CW\*(C`/proc/kmsg\*(C'\fR. If enabled, these are made inaccessible to all the processes in the unit. \fI Optional. Type boolean. \fR .SS "ProtectControlGroups" .IX Subsection "ProtectControlGroups" Takes a boolean argument. If true, the Linux Control Groups (\fBcgroups\fR\|(7)) hierarchies accessible through \f(CW\*(C`/sys/fs/cgroup/\*(C'\fR will be made read-only to all processes of the unit. Except for container managers no services should require write access to the control groups hierarchies; it is hence recommended to turn this on for most services. For this setting the same restrictions regarding mount propagation and privileges apply as for \f(CW\*(C`ReadOnlyPaths\*(C'\fR and related calls, see above. Defaults to off. If \f(CW\*(C`ProtectControlGroups\*(C'\fR is set, \f(CW\*(C`MountAPIVFS=yes\*(C'\fR is implied. \fI Optional. Type boolean. \fR .SS "RestrictAddressFamilies" .IX Subsection "RestrictAddressFamilies" Restricts the set of socket address families accessible to the processes of this unit. Takes a space-separated list of address family names to allow-list, such as \&\f(CW\*(C`AF_UNIX\*(C'\fR, \f(CW\*(C`AF_INET\*(C'\fR or \f(CW\*(C`AF_INET6\*(C'\fR. When prefixed with \f(CW\*(C`~\*(C'\fR the listed address families will be applied as deny list, otherwise as allow list. Note that this restricts access to the \fBsocket\fR\|(2) system call only. Sockets passed into the process by other means (for example, by using socket activation with socket units, see \&\fBsystemd.socket\fR\|(5)) are unaffected. Also, sockets created with \fBsocketpair()\fR (which creates connected \&\s-1AF_UNIX\s0 sockets only) are unaffected. Note that this option has no effect on 32\-bit x86, s390, s390x, mips, mips-le, ppc, ppc-le, ppc64, ppc64\-le and is ignored (but works correctly on other ABIs, including x86\-64). Note that on systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with \&\f(CW\*(C`SystemCallArchitectures=native\*(C'\fR or similar. If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \&\f(CW\*(C`User=nobody\*(C'\fR), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. By default, no restrictions apply, all address families are accessible to processes. If assigned the empty string, any previous address family restriction changes are undone. This setting does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. .PP Use this option to limit exposure of processes to remote access, in particular via exotic and sensitive network protocols, such as \f(CW\*(C`AF_PACKET\*(C'\fR. Note that in most cases, the local \&\f(CW\*(C`AF_UNIX\*(C'\fR address family should be included in the configured allow list as it is frequently used for local communication, including for \&\fBsyslog\fR\|(2) logging. \fI Optional. Type uniline. \fR .SS "RestrictNamespaces" .IX Subsection "RestrictNamespaces" Restricts access to Linux namespace functionality for the processes of this unit. For details about Linux namespaces, see \fBnamespaces\fR\|(7). Either takes a boolean argument, or a space-separated list of namespace type identifiers. If false (the default), no restrictions on namespace creation and switching are made. If true, access to any kind of namespacing is prohibited. Otherwise, a space-separated list of namespace type identifiers must be specified, consisting of any combination of: \f(CW\*(C`cgroup\*(C'\fR, \f(CW\*(C`ipc\*(C'\fR, \f(CW\*(C`net\*(C'\fR, \&\f(CW\*(C`mnt\*(C'\fR, \f(CW\*(C`pid\*(C'\fR, \f(CW\*(C`user\*(C'\fR and \f(CW\*(C`uts\*(C'\fR. Any namespace type listed is made accessible to the unit's processes, access to namespace types not listed is prohibited (allow-listing). By prepending the list with a single tilde character (\f(CW\*(C`~\*(C'\fR) the effect may be inverted: only the listed namespace types will be made inaccessible, all unlisted ones are permitted (deny-listing). If the empty string is assigned, the default namespace restrictions are applied, which is equivalent to false. This option may appear more than once, in which case the namespace types are merged by \f(CW\*(C`OR\*(C'\fR, or by \f(CW\*(C`AND\*(C'\fR if the lines are prefixed with \&\f(CW\*(C`~\*(C'\fR (see examples below). Internally, this setting limits access to the \&\fBunshare\fR\|(2), \&\fBclone\fR\|(2) and \&\fBsetns\fR\|(2) system calls, taking the specified flags parameters into account. Note that X if this option is used X in addition to restricting creation and switching of the specified types of namespaces (or all of them, if true) access to the \&\fBsetns()\fR system call with a zero flags parameter is prohibited. This setting is only supported on x86, x86\-64, mips, mips-le, mips64, mips64\-le, mips64\-n32, mips64\-le\-n32, ppc64, ppc64\-le, s390 and s390x, and enforces no restrictions on other architectures. If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. .PP Example: if a unit has the following, .PP .Vb 2 \& RestrictNamespaces=cgroup ipc \& RestrictNamespaces=cgroup net .Ve .PP then \f(CW\*(C`cgroup\*(C'\fR, \f(CW\*(C`ipc\*(C'\fR, and \f(CW\*(C`net\*(C'\fR are set. If the second line is prefixed with \f(CW\*(C`~\*(C'\fR, e.g., .PP .Vb 2 \& RestrictNamespaces=cgroup ipc \& RestrictNamespaces=~cgroup net .Ve .PP then, only \f(CW\*(C`ipc\*(C'\fR is set. \fI Optional. Type uniline. \fR .SS "LockPersonality" .IX Subsection "LockPersonality" Takes a boolean argument. If set, locks down the \fBpersonality\fR\|(2) system call so that the kernel execution domain may not be changed from the default or the personality selected with \&\f(CW\*(C`Personality\*(C'\fR directive. This may be useful to improve security, because odd personality emulations may be poorly tested and source of vulnerabilities. If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. \fI Optional. Type boolean. \fR .SS "MemoryDenyWriteExecute" .IX Subsection "MemoryDenyWriteExecute" Takes a boolean argument. If set, attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable are prohibited. Specifically, a system call filter is added that rejects \&\fBmmap\fR\|(2) system calls with both \&\f(CW\*(C`PROT_EXEC\*(C'\fR and \f(CW\*(C`PROT_WRITE\*(C'\fR set, \&\fBmprotect\fR\|(2) or \&\fBpkey_mprotect\fR\|(2) system calls with \f(CW\*(C`PROT_EXEC\*(C'\fR set and \&\fBshmat\fR\|(2) system calls with \&\f(CW\*(C`SHM_EXEC\*(C'\fR set. Note that this option is incompatible with programs and libraries that generate program code dynamically at runtime, including \s-1JIT\s0 execution engines, executable stacks, and code \&\*(L"trampoline\*(R" feature of various C compilers. This option improves service security, as it makes harder for software exploits to change running code dynamically. However, the protection can be circumvented, if the service can write to a filesystem, which is not mounted with \f(CW\*(C`noexec\*(C'\fR (such as \&\f(CW\*(C`/dev/shm\*(C'\fR), or it can use \fBmemfd_create()\fR. This can be prevented by making such file systems inaccessible to the service (e.g. \f(CW\*(C`InaccessiblePaths=/dev/shm\*(C'\fR) and installing further system call filters (\f(CW\*(C`SystemCallFilter=~memfd_create\*(C'\fR). Note that this feature is fully available on x86\-64, and partially on x86. Specifically, the \fBshmat()\fR protection is not available on x86. Note that on systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with \&\f(CW\*(C`SystemCallArchitectures=native\*(C'\fR or similar. If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \&\f(CW\*(C`User\*(C'\fR), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. \fI Optional. Type boolean. \fR .SS "RestrictRealtime" .IX Subsection "RestrictRealtime" Takes a boolean argument. If set, any attempts to enable realtime scheduling in a process of the unit are refused. This restricts access to realtime task scheduling policies such as \&\f(CW\*(C`SCHED_FIFO\*(C'\fR, \f(CW\*(C`SCHED_RR\*(C'\fR or \f(CW\*(C`SCHED_DEADLINE\*(C'\fR. See \&\fBsched\fR\|(7) for details about these scheduling policies. If running in user mode, or in system mode, but without the \&\f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. Realtime scheduling policies may be used to monopolize \s-1CPU\s0 time for longer periods of time, and may hence be used to lock up or otherwise trigger Denial-of-Service situations on the system. It is hence recommended to restrict access to realtime scheduling to the few programs that actually require them. Defaults to off. \fI Optional. Type boolean. \fR .SS "RestrictSUIDSGID" .IX Subsection "RestrictSUIDSGID" Takes a boolean argument. If set, any attempts to set the set-user-ID (\s-1SUID\s0) or set-group-ID (\s-1SGID\s0) bits on files or directories will be denied (for details on these bits see \&\fBinode\fR\|(7)). If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User\*(C'\fR), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. As the \s-1SUID/SGID\s0 bits are mechanisms to elevate privileges, and allows users to acquire the identity of other users, it is recommended to restrict creation of \s-1SUID/SGID\s0 files to the few programs that actually require them. Note that this restricts marking of any type of file system object with these bits, including both regular files and directories (where the \s-1SGID\s0 is a different meaning than for files, see documentation). This option is implied if \f(CW\*(C`DynamicUser\*(C'\fR is enabled. Defaults to off. \fI Optional. Type boolean. \fR .SS "RemoveIPC" .IX Subsection "RemoveIPC" Takes a boolean parameter. If set, all System V and \s-1POSIX IPC\s0 objects owned by the user and group the processes of this unit are run as are removed when the unit is stopped. This setting only has an effect if at least one of \f(CW\*(C`User\*(C'\fR, \f(CW\*(C`Group\*(C'\fR and \&\f(CW\*(C`DynamicUser\*(C'\fR are used. It has no effect on \s-1IPC\s0 objects owned by the root user. Specifically, this removes System V semaphores, as well as System V and \s-1POSIX\s0 shared memory segments and message queues. If multiple units use the same user or group the \s-1IPC\s0 objects are removed when the last of these units is stopped. This setting is implied if \f(CW\*(C`DynamicUser\*(C'\fR is set. \fI Optional. Type boolean. \fR .SS "PrivateMounts" .IX Subsection "PrivateMounts" Takes a boolean parameter. If set, the processes of this unit will be run in their own private file system (mount) namespace with all mount propagation from the processes towards the host's main file system namespace turned off. This means any file system mount points established or removed by the unit's processes will be private to them and not be visible to the host. However, file system mount points established or removed on the host will be propagated to the unit's processes. See \fBmount_namespaces\fR\|(7) for details on file system namespaces. Defaults to off. .PP When turned on, this executes three operations for each invoked process: a new \&\f(CW\*(C`CLONE_NEWNS\*(C'\fR namespace is created, after which all existing mounts are remounted to \&\f(CW\*(C`MS_SLAVE\*(C'\fR to disable propagation from the unit's processes to the host (but leaving propagation in the opposite direction in effect). Finally, the mounts are remounted again to the propagation mode configured with \f(CW\*(C`MountFlags\*(C'\fR, see below. .PP File system namespaces are set up individually for each process forked off by the service manager. Mounts established in the namespace of the process created by \f(CW\*(C`ExecStartPre\*(C'\fR will hence be cleaned up automatically as soon as that process exits and will not be available to subsequent processes forked off for \&\f(CW\*(C`ExecStart\*(C'\fR (and similar applies to the various other commands configured for units). Similarly, \f(CW\*(C`JoinsNamespaceOf\*(C'\fR does not permit sharing kernel mount namespaces between units, it only enables sharing of the \f(CW\*(C`/tmp/\*(C'\fR and \f(CW\*(C`/var/tmp/\*(C'\fR directories. .PP Other file system namespace unit settings X \f(CW\*(C`PrivateMounts\*(C'\fR, \&\f(CW\*(C`PrivateTmp\*(C'\fR, \f(CW\*(C`PrivateDevices\*(C'\fR, \f(CW\*(C`ProtectSystem\*(C'\fR, \&\f(CW\*(C`ProtectHome\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR, \f(CW\*(C`InaccessiblePaths\*(C'\fR, \&\f(CW\*(C`ReadWritePaths\*(C'\fR, X X also enable file system namespacing in a fashion equivalent to this option. Hence it is primarily useful to explicitly request this behaviour if none of the other settings are used. \fI Optional. Type boolean. \fR .SS "MountFlags" .IX Subsection "MountFlags" Takes a mount propagation setting: \f(CW\*(C`shared\*(C'\fR, \f(CW\*(C`slave\*(C'\fR or \&\f(CW\*(C`private\*(C'\fR, which controls whether file system mount points in the file system namespaces set up for this unit's processes will receive or propagate mounts and unmounts from other file system namespaces. See \&\fBmount\fR\|(2) for details on mount propagation, and the three propagation flags in particular. .PP This setting only controls the final propagation setting in effect on all mount points of the file system namespace created for each process of this unit. Other file system namespacing unit settings (see the discussion in \f(CW\*(C`PrivateMounts\*(C'\fR above) will implicitly disable mount and unmount propagation from the unit's processes towards the host by changing the propagation setting of all mount points in the unit's file system namespace to \f(CW\*(C`slave\*(C'\fR first. Setting this option to \&\f(CW\*(C`shared\*(C'\fR does not reestablish propagation in that case. .PP If not set X but file system namespaces are enabled through another file system namespace unit setting X \&\f(CW\*(C`shared\*(C'\fR mount propagation is used, but X as mentioned X as \f(CW\*(C`slave\*(C'\fR is applied first, propagation from the unit's processes to the host is still turned off. .PP It is not recommended to use \f(CW\*(C`private\*(C'\fR mount propagation for units, as this means temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked off processes, as unmount propagation events won't be received by the file system namespace of the unit. .PP Usually, it is best to leave this setting unmodified, and use higher level file system namespacing options instead, in particular \f(CW\*(C`PrivateMounts\*(C'\fR, see above. \fI Optional. Type uniline. \fR .SS "SystemCallFilter" .IX Subsection "SystemCallFilter" Takes a space-separated list of system call names. If this setting is used, all system calls executed by the unit processes except for the listed ones will result in immediate process termination with the \f(CW\*(C`SIGSYS\*(C'\fR signal (allow-listing). (See \&\f(CW\*(C`SystemCallErrorNumber\*(C'\fR below for changing the default action). If the first character of the list is \f(CW\*(C`~\*(C'\fR, the effect is inverted: only the listed system calls will result in immediate process termination (deny-listing). Deny-listed system calls and system call groups may optionally be suffixed with a colon (\f(CW\*(C`:\*(C'\fR) and \f(CW\*(C`errno\*(C'\fR error number (between 0 and 4095) or errno name such as \f(CW\*(C`EPERM\*(C'\fR, \&\f(CW\*(C`EACCES\*(C'\fR or \f(CW\*(C`EUCLEAN\*(C'\fR (see \fBerrno\fR\|(3) for a full list). This value will be returned when a deny-listed system call is triggered, instead of terminating the processes immediately. Special setting \f(CW\*(C`kill\*(C'\fR can be used to explicitly specify killing. This value takes precedence over the one given in \&\f(CW\*(C`SystemCallErrorNumber\*(C'\fR, see below. If running in user mode, or in system mode, but without the \f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \&\f(CW\*(C`User=nobody\*(C'\fR), \f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel ('seccomp filtering') and is useful for enforcing a minimal sandboxing environment. Note that the \fBexecve()\fR, \&\fBexit()\fR, \fBexit_group()\fR, \fBgetrlimit()\fR, \&\fBrt_sigreturn()\fR, \fBsigreturn()\fR system calls and the system calls for querying time and sleeping are implicitly allow-listed and do not need to be listed explicitly. This option may be specified more than once, in which case the filter masks are merged. If the empty string is assigned, the filter is reset, all prior assignments will have no effect. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. .PP Note that on systems supporting multiple ABIs (such as x86/x86\-64) it is recommended to turn off alternative ABIs for services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is recommended to combine this option with \&\f(CW\*(C`SystemCallArchitectures=native\*(C'\fR or similar. .PP Note that strict system call filters may impact execution and error handling code paths of the service invocation. Specifically, access to the \fBexecve()\fR system call is required for the execution of the service binary X if it is blocked service invocation will necessarily fail. Also, if execution of the service binary fails for some reason (for example: missing service executable), the error handling logic might require access to an additional set of system calls in order to process and log this failure correctly. It might be necessary to temporarily disable system call filters in order to simplify debugging of such failures. .PP If you specify both types of this option (i.e. allow-listing and deny-listing), the first encountered will take precedence and will dictate the default action (termination or approval of a system call). Then the next occurrences of this option will add or delete the listed system calls from the set of the filtered system calls, depending of its type and the default action. (For example, if you have started with an allow list rule for \fBread()\fR and \&\fBwrite()\fR, and right after it add a deny list rule for \fBwrite()\fR, then \fBwrite()\fR will be removed from the set.) .PP As the number of possible system calls is large, predefined sets of system calls are provided. A set starts with \f(CW\*(C`@\*(C'\fR character, followed by name of the set. Currently predefined system call setsSetDescription@aioAsynchronous I/O (\fBio_setup\fR\|(2), \fBio_submit\fR\|(2), and related calls)@basic\-ioSystem calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing (\fBread\fR\|(2), \fBwrite\fR\|(2), and related calls)@chownChanging file ownership (\fBchown\fR\|(2), \fBfchownat\fR\|(2), and related calls)@clockSystem calls for changing the system clock (\fBadjtimex\fR\|(2), \fBsettimeofday\fR\|(2), and related calls)@cpu\-emulationSystem calls for \s-1CPU\s0 emulation functionality (\fBvm86\fR\|(2) and related calls)@debugDebugging, performance monitoring and tracing functionality (\fBptrace\fR\|(2), \fBperf_event_open\fR\|(2) and related calls)@file\-systemFile system operations: opening, creating files and directories for read and write, renaming and removing them, reading file properties, or creating hard and symbolic links@io\-eventEvent loop system calls (\fBpoll\fR\|(2), \fBselect\fR\|(2), \fBepoll\fR\|(7), \fBeventfd\fR\|(2) and related calls)@ipcPipes, SysV \s-1IPC, POSIX\s0 Message Queues and other \s-1IPC\s0 (\fBmq_overview\fR\|(7), \fBsvipc\fR\|(7))@keyringKernel keyring access (\fBkeyctl\fR\|(2) and related calls)@memlockLocking of memory in \s-1RAM\s0 (\fBmlock\fR\|(2), \fBmlockall\fR\|(2) and related calls)@moduleLoading and unloading of kernel modules (\fBinit_module\fR\|(2), \fBdelete_module\fR\|(2) and related calls)@mountMounting and unmounting of file systems (\fBmount\fR\|(2), \fBchroot\fR\|(2), and related calls)@network\-ioSocket I/O (including local \s-1AF_UNIX\s0): \fBsocket\fR\|(7), \fBunix\fR\|(7)\f(CW@obsoleteUnusual\fR, obsolete or unimplemented (\fBcreate_module\fR\|(2), \fBgtty\fR\|(2), X)@privilegedAll system calls which need super-user capabilities (\fBcapabilities\fR\|(7))@processProcess control, execution, namespacing operations (\fBclone\fR\|(2), \fBkill\fR\|(2), \fBnamespaces\fR\|(7), X)@raw\-ioRaw I/O port access (\fBioperm\fR\|(2), \fBiopl\fR\|(2), \fBpciconfig_read()\fR, X)@rebootSystem calls for rebooting and reboot preparation (\fBreboot\fR\|(2), \fBkexec()\fR, X)@resourcesSystem calls for changing resource limits, memory and scheduling parameters (\fBsetrlimit\fR\|(2), \fBsetpriority\fR\|(2), X)@setuidSystem calls for changing user \s-1ID\s0 and group \s-1ID\s0 credentials, (\fBsetuid\fR\|(2), \fBsetgid\fR\|(2), \fBsetresuid\fR\|(2), X)@signalSystem calls for manipulating and handling process signals (\fBsignal\fR\|(2), \fBsigprocmask\fR\|(2), X)@swapSystem calls for enabling/disabling swap devices (\fBswapon\fR\|(2), \fBswapoff\fR\|(2))@syncSynchronizing files and memory to disk (\fBfsync\fR\|(2), \fBmsync\fR\|(2), and related calls)@system\-serviceA reasonable set of system calls used by common system services, excluding any special purpose calls. This is the recommended starting point for allow-listing system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: \f(CW@clock\fR, \f(CW@mount\fR, \f(CW@swap\fR, \f(CW@reboot\fR.@timerSystem calls for scheduling operations by time (\fBalarm\fR\|(2), \fBtimer_create\fR\|(2), X)@knownAll system calls defined by the kernel. This list is defined statically in systemd based on a kernel version that was available when this systemd version was released. It will become progressively more out-of-date as the kernel is updated. Note, that as new system calls are added to the kernel, additional system calls might be added to the groups above. Contents of the sets may also change between systemd versions. In addition, the list of system calls depends on the kernel version and architecture for which systemd was compiled. Use systemd-analyze\ syscall-filter to list the actual list of system calls in each filter. .PP Generally, allow-listing system calls (rather than deny-listing) is the safer mode of operation. It is recommended to enforce system call allow lists for all long-running system services. Specifically, the following lines are a relatively safe basic choice for the majority of system services: .PP Note that various kernel system calls are defined redundantly: there are multiple system calls for executing the same operation. For example, the \fBpidfd_send_signal()\fR system call may be used to execute operations similar to what can be done with the older \&\fBkill()\fR system call, hence blocking the latter without the former only provides weak protection. Since new system calls are added regularly to the kernel as development progresses, keeping system call deny lists comprehensive requires constant work. It is thus recommended to use allow-listing instead, which offers the benefit that new system calls are by default implicitly blocked until the allow list is updated. .PP Also note that a number of system calls are required to be accessible for the dynamic linker to work. The dynamic linker is required for running most regular programs (specifically: all dynamic \s-1ELF\s0 binaries, which is how most distributions build packaged programs). This means that blocking these system calls (which include \fBopen()\fR, \fBopenat()\fR or \&\fBmmap()\fR) will make most programs typically shipped with generic distributions unusable. .PP It is recommended to combine the file system namespacing related options with \&\f(CW\*(C`SystemCallFilter=~@mount\*(C'\fR, in order to prohibit the unit's processes to undo the mappings. Specifically these are the options \f(CW\*(C`PrivateTmp\*(C'\fR, \&\f(CW\*(C`PrivateDevices\*(C'\fR, \f(CW\*(C`ProtectSystem\*(C'\fR, \f(CW\*(C`ProtectHome\*(C'\fR, \&\f(CW\*(C`ProtectKernelTunables\*(C'\fR, \f(CW\*(C`ProtectControlGroups\*(C'\fR, \&\f(CW\*(C`ProtectKernelLogs\*(C'\fR, \f(CW\*(C`ProtectClock\*(C'\fR, \f(CW\*(C`ReadOnlyPaths\*(C'\fR, \&\f(CW\*(C`InaccessiblePaths\*(C'\fR and \f(CW\*(C`ReadWritePaths\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "SystemCallErrorNumber" .IX Subsection "SystemCallErrorNumber" Takes an \f(CW\*(C`errno\*(C'\fR error number (between 1 and 4095) or errno name such as \f(CW\*(C`EPERM\*(C'\fR, \f(CW\*(C`EACCES\*(C'\fR or \f(CW\*(C`EUCLEAN\*(C'\fR, to return when the system call filter configured with \f(CW\*(C`SystemCallFilter\*(C'\fR is triggered, instead of terminating the process immediately. See \fBerrno\fR\|(3) for a full list of error codes. When this setting is not used, or when the empty string or the special setting \f(CW\*(C`kill\*(C'\fR is assigned, the process will be terminated immediately when the filter is triggered. \fI Optional. Type uniline. \fR .SS "SystemCallArchitectures" .IX Subsection "SystemCallArchitectures" Takes a space-separated list of architecture identifiers to include in the system call filter. The known architecture identifiers are the same as for \f(CW\*(C`ConditionArchitecture\*(C'\fR described in \fBsystemd.unit\fR\|(5), as well as \f(CW\*(C`x32\*(C'\fR, \f(CW\*(C`mips64\-n32\*(C'\fR, \f(CW\*(C`mips64\-le\-n32\*(C'\fR, and the special identifier \f(CW\*(C`native\*(C'\fR. The special identifier \f(CW\*(C`native\*(C'\fR implicitly maps to the native architecture of the system (or more precisely: to the architecture the system manager is compiled for). If running in user mode, or in system mode, but without the \&\f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User=nobody\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. By default, this option is set to the empty list, i.e. no filtering is applied. .PP If this setting is used, processes of this unit will only be permitted to call native system calls, and system calls of the specified architectures. For the purposes of this option, the x32 architecture is treated as including x86\-64 system calls. However, this setting still fulfills its purpose, as explained below, on x32. .PP System call filtering is not equally effective on all architectures. For example, on x86 filtering of network socket-related calls is not possible, due to \s-1ABI\s0 limitations X a limitation that x86\-64 does not have, however. On systems supporting multiple ABIs at the same time X such as x86/x86\-64 X it is hence recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to circumvent the restrictions applied to the native \s-1ABI\s0 of the system. In particular, setting \&\f(CW\*(C`SystemCallArchitectures=native\*(C'\fR is a good choice for disabling non-native ABIs. .PP System call architectures may also be restricted system-wide via the \&\f(CW\*(C`SystemCallArchitectures\*(C'\fR option in the global configuration. See \&\fBsystemd\-system.conf\fR\|(5) for details. \fI Optional. Type uniline. \fR .SS "SystemCallLog" .IX Subsection "SystemCallLog" Takes a space-separated list of system call names. If this setting is used, all system calls executed by the unit processes for the listed ones will be logged. If the first character of the list is \f(CW\*(C`~\*(C'\fR, the effect is inverted: all system calls except the listed system calls will be logged. If running in user mode, or in system mode, but without the \&\f(CW\*(C`CAP_SYS_ADMIN\*(C'\fR capability (e.g. setting \f(CW\*(C`User=nobody\*(C'\fR), \&\f(CW\*(C`NoNewPrivileges=yes\*(C'\fR is implied. This feature makes use of the Secure Computing Mode 2 interfaces of the kernel ('seccomp filtering') and is useful for auditing or setting up a minimal sandboxing environment. This option may be specified more than once, in which case the filter masks are merged. If the empty string is assigned, the filter is reset, all prior assignments will have no effect. This does not affect commands prefixed with \f(CW\*(C`+\*(C'\fR. \fI Optional. Type list of uniline. \fR .SS "Environment" .IX Subsection "Environment" Sets environment variables for executed processes. Takes a space-separated list of variable assignments. This option may be specified more than once, in which case all listed variables will be set. If the same variable is set twice, the later setting will override the earlier setting. If the empty string is assigned to this option, the list of environment variables is reset, all prior assignments have no effect. Variable expansion is not performed inside the strings, however, specifier expansion is possible. The \f(CW\*(C`$\*(C'\fR character has no special meaning. If you need to assign a value containing spaces or the equals sign to a variable, use double quotes (") for the assignment. .PP The names of the variables can contain \s-1ASCII\s0 letters, digits, and the underscore character. Variable names cannot be empty or start with a digit. In variable values, most characters are allowed, but non-printable characters are currently rejected. .PP Example: .PP .Vb 1 \& Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" .Ve .PP gives three variables \f(CW\*(C`VAR1\*(C'\fR, \&\f(CW\*(C`VAR2\*(C'\fR, \f(CW\*(C`VAR3\*(C'\fR with the values \f(CW\*(C`word1 word2\*(C'\fR, \&\f(CW\*(C`word3\*(C'\fR, \f(CW\*(C`$word 5 6\*(C'\fR. .PP See \fBenviron\fR\|(7) for details about environment variables. .PP Note that environment variables are not suitable for passing secrets (such as passwords, key material, X) to service processes. Environment variables set for a unit are exposed to unprivileged clients via D\-Bus \s-1IPC,\s0 and generally not understood as being data that requires protection. Moreover, environment variables are propagated down the process tree, including across security boundaries (such as setuid/setgid executables), and hence might leak to processes that should not have access to the secret data. Use \f(CW\*(C`LoadCredential\*(C'\fR (see below) to pass data to unit processes securely. \fI Optional. Type list of uniline. \fR .SS "EnvironmentFile" .IX Subsection "EnvironmentFile" Similar to \f(CW\*(C`Environment\*(C'\fR but reads the environment variables from a text file. The text file should contain new-line-separated variable assignments. Empty lines, lines without an \&\f(CW\*(C`=\*(C'\fR separator, or lines starting with ; or # will be ignored, which may be used for commenting. A line ending with a backslash will be concatenated with the following one, allowing multiline variable definitions. The parser strips leading and trailing whitespace from the values of assignments, unless you use double quotes ("). .PP C escapes are supported, but not most control characters . \&\f(CW\*(C`\et\*(C'\fR and \f(CW\*(C`\en\*(C'\fR can be used to insert tabs and newlines within \&\f(CW\*(C`EnvironmentFile\*(C'\fR. .PP The argument passed should be an absolute filename or wildcard expression, optionally prefixed with \&\f(CW\*(C`\-\*(C'\fR, which indicates that if the file does not exist, it will not be read and no error or warning message is logged. This option may be specified more than once in which case all specified files are read. If the empty string is assigned to this option, the list of file to read is reset, all prior assignments have no effect. .PP The files listed with this directive will be read shortly before the process is executed (more specifically, after all processes from a previous unit state terminated. This means you can generate these files in one unit state, and read it with this option in the next. The files are read from the file system of the service manager, before any file system changes like bind mounts take place). .PP Settings from these files override settings made with \f(CW\*(C`Environment\*(C'\fR. If the same variable is set twice from these files, the files will be read in the order they are specified and the later setting will override the earlier setting. \fI Optional. Type list of uniline. \fR .SS "PassEnvironment" .IX Subsection "PassEnvironment" Pass environment variables set for the system service manager to executed processes. Takes a space-separated list of variable names. This option may be specified more than once, in which case all listed variables will be passed. If the empty string is assigned to this option, the list of environment variables to pass is reset, all prior assignments have no effect. Variables specified that are not set for the system manager will not be passed and will be silently ignored. Note that this option is only relevant for the system service manager, as system services by default do not automatically inherit any environment variables set for the service manager itself. However, in case of the user service manager all environment variables are passed to the executed processes anyway, hence this option is without effect for the user service manager. .PP Variables set for invoked processes due to this setting are subject to being overridden by those configured with \f(CW\*(C`Environment\*(C'\fR or \f(CW\*(C`EnvironmentFile\*(C'\fR. .PP C escapes are supported, but not most control characters . \&\f(CW\*(C`\et\*(C'\fR and \f(CW\*(C`\en\*(C'\fR can be used to insert tabs and newlines within \&\f(CW\*(C`EnvironmentFile\*(C'\fR. .PP Example: .PP .Vb 1 \& PassEnvironment=VAR1 VAR2 VAR3 .Ve .PP passes three variables \f(CW\*(C`VAR1\*(C'\fR, \&\f(CW\*(C`VAR2\*(C'\fR, \f(CW\*(C`VAR3\*(C'\fR with the values set for those variables in \s-1PID1.\s0 .PP See \fBenviron\fR\|(7) for details about environment variables. \fI Optional. Type list of uniline. \fR .SS "UnsetEnvironment" .IX Subsection "UnsetEnvironment" Explicitly unset environment variable assignments that would normally be passed from the service manager to invoked processes of this unit. Takes a space-separated list of variable names or variable assignments. This option may be specified more than once, in which case all listed variables/assignments will be unset. If the empty string is assigned to this option, the list of environment variables/assignments to unset is reset. If a variable assignment is specified (that is: a variable name, followed by \&\f(CW\*(C`=\*(C'\fR, followed by its value), then any environment variable matching this precise assignment is removed. If a variable name is specified (that is a variable name without any following \f(CW\*(C`=\*(C'\fR or value), then any assignment matching the variable name, regardless of its value is removed. Note that the effect of \f(CW\*(C`UnsetEnvironment\*(C'\fR is applied as final step when the environment list passed to executed processes is compiled. That means it may undo assignments from any configuration source, including assignments made through \f(CW\*(C`Environment\*(C'\fR or \f(CW\*(C`EnvironmentFile\*(C'\fR, inherited from the system manager's global set of environment variables, inherited via \f(CW\*(C`PassEnvironment\*(C'\fR, set by the service manager itself (such as \f(CW$NOTIFY_SOCKET\fR and such), or set by a \s-1PAM\s0 module (in case \f(CW\*(C`PAMName\*(C'\fR is used). .PP See \fBenviron\fR\|(7) for details about environment variables. \fI Optional. Type list of uniline. \fR .SS "StandardInput" .IX Subsection "StandardInput" Controls where file descriptor 0 (\s-1STDIN\s0) of the executed processes is connected to. Takes one of \f(CW\*(C`null\*(C'\fR, \f(CW\*(C`tty\*(C'\fR, \f(CW\*(C`tty\-force\*(C'\fR, \f(CW\*(C`tty\-fail\*(C'\fR, \&\f(CW\*(C`data\*(C'\fR, \f(CW\*(C`file:path\*(C'\fR, \f(CW\*(C`socket\*(C'\fR or \&\f(CW\*(C`fd:name\*(C'\fR. .PP If \f(CW\*(C`null\*(C'\fR is selected, standard input will be connected to \f(CW\*(C`/dev/null\*(C'\fR, i.e. all read attempts by the process will result in immediate \s-1EOF.\s0 .PP If \f(CW\*(C`tty\*(C'\fR is selected, standard input is connected to a \s-1TTY\s0 (as configured by \&\f(CW\*(C`TTYPath\*(C'\fR, see below) and the executed process becomes the controlling process of the terminal. If the terminal is already being controlled by another process, the executed process waits until the current controlling process releases the terminal. .PP \&\f(CW\*(C`tty\-force\*(C'\fR is similar to \f(CW\*(C`tty\*(C'\fR, but the executed process is forcefully and immediately made the controlling process of the terminal, potentially removing previous controlling processes from the terminal. .PP \&\f(CW\*(C`tty\-fail\*(C'\fR is similar to \f(CW\*(C`tty\*(C'\fR, but if the terminal already has a controlling process start-up of the executed process fails. .PP The \f(CW\*(C`data\*(C'\fR option may be used to configure arbitrary textual or binary data to pass via standard input to the executed process. The data to pass is configured via \&\f(CW\*(C`StandardInputText\*(C'\fR/\f(CW\*(C`StandardInputData\*(C'\fR (see below). Note that the actual file descriptor type passed (memory file, regular file, \s-1UNIX\s0 pipe, X) might depend on the kernel and available privileges. In any case, the file descriptor is read-only, and when read returns the specified data followed by \&\s-1EOF.\s0 .PP The \f(CW\*(C`file:path\*(C'\fR option may be used to connect a specific file system object to standard input. An absolute path following the \f(CW\*(C`:\*(C'\fR character is expected, which may refer to a regular file, a \s-1FIFO\s0 or special file. If an \f(CW\*(C`AF_UNIX\*(C'\fR socket in the file system is specified, a stream socket is connected to it. The latter is useful for connecting standard input of processes to arbitrary system services. .PP The \f(CW\*(C`socket\*(C'\fR option is valid in socket-activated services only, and requires the relevant socket unit file (see \&\fBsystemd.socket\fR\|(5) for details) to have \f(CW\*(C`Accept=yes\*(C'\fR set, or to specify a single socket only. If this option is set, standard input will be connected to the socket the service was activated from, which is primarily useful for compatibility with daemons designed for use with the traditional \fBinetd\fR\|(8) socket activation daemon. .PP The \f(CW\*(C`fd:name\*(C'\fR option connects standard input to a specific, named file descriptor provided by a socket unit. The name may be specified as part of this option, following a \&\f(CW\*(C`:\*(C'\fR character (e.g. \f(CW\*(C`fd:foobar\*(C'\fR). If no name is specified, the name \&\f(CW\*(C`stdin\*(C'\fR is implied (i.e. \f(CW\*(C`fd\*(C'\fR is equivalent to \f(CW\*(C`fd:stdin\*(C'\fR). At least one socket unit defining the specified name must be provided via the \f(CW\*(C`Sockets\*(C'\fR option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See \f(CW\*(C`FileDescriptorName\*(C'\fR in \&\fBsystemd.socket\fR\|(5) for more details about named file descriptors and their ordering. .PP This setting defaults to \f(CW\*(C`null\*(C'\fR. \fI Optional. Type enum. choice: 'null', 'tty', 'tty\-force', 'tty\-fail', 'data', 'socket'. \fR .SS "StandardOutput" .IX Subsection "StandardOutput" Controls where file descriptor 1 (stdout) of the executed processes is connected to. Takes one of \f(CW\*(C`inherit\*(C'\fR, \f(CW\*(C`null\*(C'\fR, \f(CW\*(C`tty\*(C'\fR, \&\f(CW\*(C`journal\*(C'\fR, \f(CW\*(C`kmsg\*(C'\fR, \f(CW\*(C`journal+console\*(C'\fR, \&\f(CW\*(C`kmsg+console\*(C'\fR, \f(CW\*(C`file:path\*(C'\fR, \&\f(CW\*(C`append:path\*(C'\fR, \f(CW\*(C`socket\*(C'\fR or \&\f(CW\*(C`fd:name\*(C'\fR. .PP \&\f(CW\*(C`inherit\*(C'\fR duplicates the file descriptor of standard input for standard output. .PP \&\f(CW\*(C`null\*(C'\fR connects standard output to \f(CW\*(C`/dev/null\*(C'\fR, i.e. everything written to it will be lost. .PP \&\f(CW\*(C`tty\*(C'\fR connects standard output to a tty (as configured via \f(CW\*(C`TTYPath\*(C'\fR, see below). If the \s-1TTY\s0 is used for output only, the executed process will not become the controlling process of the terminal, and will not fail or wait for other processes to release the terminal. .PP \&\f(CW\*(C`journal\*(C'\fR connects standard output with the journal, which is accessible via \&\fBjournalctl\fR\|(1). Note that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the specific option listed below is hence a superset of this one. (Also note that any external, additional syslog daemons receive their log data from the journal, too, hence this is the option to use when logging shall be processed with such a daemon.) .PP \&\f(CW\*(C`kmsg\*(C'\fR connects standard output with the kernel log buffer which is accessible via \&\fBdmesg\fR\|(1), in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which case this option is no different from \f(CW\*(C`journal\*(C'\fR. .PP \&\f(CW\*(C`journal+console\*(C'\fR and \f(CW\*(C`kmsg+console\*(C'\fR work in a similar way as the two options above but copy the output to the system console as well. .PP The \f(CW\*(C`file:path\*(C'\fR option may be used to connect a specific file system object to standard output. The semantics are similar to the same option of \&\f(CW\*(C`StandardInput\*(C'\fR, see above. If path refers to a regular file on the filesystem, it is opened (created if it doesn't exist yet) for writing at the beginning of the file, but without truncating it. If standard input and output are directed to the same file path, it is opened only once, for reading as well as writing and duplicated. This is particularly useful when the specified path refers to an \&\f(CW\*(C`AF_UNIX\*(C'\fR socket in the file system, as in that case only a single stream connection is created for both input and output. .PP \&\f(CW\*(C`append:path\*(C'\fR is similar to \&\f(CW\*(C`file:path\*(C'\fR above, but it opens the file in append mode. .PP \&\f(CW\*(C`socket\*(C'\fR connects standard output to a socket acquired via socket activation. The semantics are similar to the same option of \f(CW\*(C`StandardInput\*(C'\fR, see above. .PP The \f(CW\*(C`fd:name\*(C'\fR option connects standard output to a specific, named file descriptor provided by a socket unit. A name may be specified as part of this option, following a \&\f(CW\*(C`:\*(C'\fR character (e.g. \f(CW\*(C`fd:foobar\*(C'\fR). If no name is specified, the name \&\f(CW\*(C`stdout\*(C'\fR is implied (i.e. \f(CW\*(C`fd\*(C'\fR is equivalent to \&\f(CW\*(C`fd:stdout\*(C'\fR). At least one socket unit defining the specified name must be provided via the \&\f(CW\*(C`Sockets\*(C'\fR option, and the file descriptor name may differ from the name of its containing socket unit. If multiple matches are found, the first one will be used. See \&\f(CW\*(C`FileDescriptorName\*(C'\fR in \&\fBsystemd.socket\fR\|(5) for more details about named descriptors and their ordering. .PP If the standard output (or error output, see below) of a unit is connected to the journal or the kernel log buffer, the unit will implicitly gain a dependency of type \f(CW\*(C`After\*(C'\fR on \f(CW\*(C`systemd\-journald.socket\*(C'\fR (also see the \*(L"Implicit Dependencies\*(R" section above). Also note that in this case stdout (or stderr, see below) will be an \&\f(CW\*(C`AF_UNIX\*(C'\fR stream socket, and not a pipe or \s-1FIFO\s0 that can be re-opened. This means when executing shell scripts the construct echo \*(L"hello\*(R" > /dev/stderr for writing text to stderr will not work. To mitigate this use the construct echo \*(L"hello\*(R" >&2 instead, which is mostly equivalent and avoids this pitfall. .PP This setting defaults to the value set with \f(CW\*(C`DefaultStandardOutput\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5), which defaults to \f(CW\*(C`journal\*(C'\fR. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). \fI Optional. Type enum. choice: 'inherit', 'null', 'tty', 'journal', 'kmsg', 'journal+console', 'kmsg+console', 'socket'. \fR .SS "StandardError" .IX Subsection "StandardError" Controls where file descriptor 2 (stderr) of the executed processes is connected to. The available options are identical to those of \f(CW\*(C`StandardOutput\*(C'\fR, with some exceptions: if set to \&\f(CW\*(C`inherit\*(C'\fR the file descriptor used for standard output is duplicated for standard error, while \&\f(CW\*(C`fd:name\*(C'\fR will use a default file descriptor name of \&\f(CW\*(C`stderr\*(C'\fR. .PP This setting defaults to the value set with \f(CW\*(C`DefaultStandardError\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5), which defaults to \f(CW\*(C`inherit\*(C'\fR. Note that setting this parameter might result in additional dependencies to be added to the unit (see above). \fI Optional. Type uniline. \fR .SS "StandardInputText" .IX Subsection "StandardInputText" Configures arbitrary textual or binary data to pass via file descriptor 0 (\s-1STDIN\s0) to the executed processes. These settings have no effect unless \f(CW\*(C`StandardInput\*(C'\fR is set to \&\f(CW\*(C`data\*(C'\fR. Use this option to embed process input data directly in the unit file. .PP \&\f(CW\*(C`StandardInputText\*(C'\fR accepts arbitrary textual data. C\-style escapes for special characters as well as the usual \f(CW\*(C`%\*(C'\fR\-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional \f(CW\*(C`\en\*(C'\fR to the end or beginning of a line). .PP \&\f(CW\*(C`StandardInputData\*(C'\fR accepts arbitrary binary data, encoded in Base64 . No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. .PP Note that \f(CW\*(C`StandardInputText\*(C'\fR and \f(CW\*(C`StandardInputData\*(C'\fR operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. .PP Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a \f(CW\*(C`\e\*(C'\fR character (see \&\fBsystemd.unit\fR\|(5) for details). This is particularly useful for large data configured with these two options. Example: \fI Optional. Type uniline. \fR .SS "StandardInputData" .IX Subsection "StandardInputData" Configures arbitrary textual or binary data to pass via file descriptor 0 (\s-1STDIN\s0) to the executed processes. These settings have no effect unless \f(CW\*(C`StandardInput\*(C'\fR is set to \&\f(CW\*(C`data\*(C'\fR. Use this option to embed process input data directly in the unit file. .PP \&\f(CW\*(C`StandardInputText\*(C'\fR accepts arbitrary textual data. C\-style escapes for special characters as well as the usual \f(CW\*(C`%\*(C'\fR\-specifiers are resolved. Each time this setting is used the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an empty line, add an additional \f(CW\*(C`\en\*(C'\fR to the end or beginning of a line). .PP \&\f(CW\*(C`StandardInputData\*(C'\fR accepts arbitrary binary data, encoded in Base64 . No escape sequences or specifiers are resolved. Any whitespace in the encoded version is ignored during decoding. .PP Note that \f(CW\*(C`StandardInputText\*(C'\fR and \f(CW\*(C`StandardInputData\*(C'\fR operate on the same data buffer, and may be mixed in order to configure both binary and textual data for the same input stream. The textual or binary data is joined strictly in the order the settings appear in the unit file. Assigning an empty string to either will reset the data buffer. .PP Please keep in mind that in order to maintain readability long unit file settings may be split into multiple lines, by suffixing each line (except for the last) with a \f(CW\*(C`\e\*(C'\fR character (see \&\fBsystemd.unit\fR\|(5) for details). This is particularly useful for large data configured with these two options. Example: \fI Optional. Type uniline. \fR .SS "LogLevelMax" .IX Subsection "LogLevelMax" Configures filtering by log level of log messages generated by this unit. Takes a syslog log level, one of \f(CW\*(C`emerg\*(C'\fR (lowest log level, only highest priority messages), \f(CW\*(C`alert\*(C'\fR, \f(CW\*(C`crit\*(C'\fR, \f(CW\*(C`err\*(C'\fR, \f(CW\*(C`warning\*(C'\fR, \&\f(CW\*(C`notice\*(C'\fR, \f(CW\*(C`info\*(C'\fR, \f(CW\*(C`debug\*(C'\fR (highest log level, also lowest priority messages). See \fBsyslog\fR\|(3) for details. By default no filtering is applied (i.e. the default maximum log level is \f(CW\*(C`debug\*(C'\fR). Use this option to configure the logging system to drop log messages of a specific service above the specified level. For example, set \f(CW\*(C`LogLevelMax\*(C'\fR\f(CW\*(C`info\*(C'\fR in order to turn off debug logging of a particularly chatty unit. Note that the configured level is applied to any log messages written by any of the processes belonging to this unit, sent via any supported logging protocol. The filtering is applied early in the logging pipeline, before any kind of further processing is done. Moreover, messages which pass through this filter successfully might still be dropped by filters applied at a later stage in the logging subsystem. For example, \f(CW\*(C`MaxLevelStore\*(C'\fR configured in \&\fBjournald.conf\fR\|(5) might prohibit messages of higher log levels to be stored on disk, even though the per-unit \&\f(CW\*(C`LogLevelMax\*(C'\fR permitted it to be processed. \fI Optional. Type uniline. \fR .SS "LogExtraFields" .IX Subsection "LogExtraFields" Configures additional log metadata fields to include in all log records generated by processes associated with this unit. This setting takes one or more journal field assignments in the format \f(CW\*(C`FIELD=VALUE\*(C'\fR separated by whitespace. See \&\fBsystemd.journal\-fields\fR\|(7) for details on the journal field concept. Even though the underlying journal implementation permits binary field values, this setting accepts only valid \s-1UTF\-8\s0 values. To include space characters in a journal field value, enclose the assignment in double quotes ("). The usual specifiers are expanded in all assignments (see below). Note that this setting is not only useful for attaching additional metadata to log records of a unit, but given that all fields and values are indexed may also be used to implement cross-unit log record matching. Assign an empty string to reset the list. \fI Optional. Type uniline. \fR .SS "LogRateLimitIntervalSec" .IX Subsection "LogRateLimitIntervalSec" Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by \f(CW\*(C`LogRateLimitIntervalSec\*(C'\fR, more messages than specified in \&\f(CW\*(C`LogRateLimitBurst\*(C'\fR are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for \f(CW\*(C`LogRateLimitIntervalSec\*(C'\fR may be specified in the following units: \*(L"s\*(R", \&\*(L"min\*(R", \*(L"h\*(R", \*(L"ms\*(R", \*(L"us\*(R" (see \&\fBsystemd.time\fR\|(7) for details). The default settings are set by \f(CW\*(C`RateLimitIntervalSec\*(C'\fR and \f(CW\*(C`RateLimitBurst\*(C'\fR configured in \fBjournald.conf\fR\|(5). \&\fI Optional. Type uniline. \fR .SS "LogRateLimitBurst" .IX Subsection "LogRateLimitBurst" Configures the rate limiting that is applied to messages generated by this unit. If, in the time interval defined by \f(CW\*(C`LogRateLimitIntervalSec\*(C'\fR, more messages than specified in \&\f(CW\*(C`LogRateLimitBurst\*(C'\fR are logged by a service, all further messages within the interval are dropped until the interval is over. A message about the number of dropped messages is generated. The time specification for \f(CW\*(C`LogRateLimitIntervalSec\*(C'\fR may be specified in the following units: \*(L"s\*(R", \&\*(L"min\*(R", \*(L"h\*(R", \*(L"ms\*(R", \*(L"us\*(R" (see \&\fBsystemd.time\fR\|(7) for details). The default settings are set by \f(CW\*(C`RateLimitIntervalSec\*(C'\fR and \f(CW\*(C`RateLimitBurst\*(C'\fR configured in \fBjournald.conf\fR\|(5). \&\fI Optional. Type uniline. \fR .SS "LogNamespace" .IX Subsection "LogNamespace" Run the unit's processes in the specified journal namespace. Expects a short user-defined string identifying the namespace. If not used the processes of the service are run in the default journal namespace, i.e. their log stream is collected and processed by \&\f(CW\*(C`systemd\-journald.service\*(C'\fR. If this option is used any log data generated by processes of this unit (regardless if via the \fBsyslog()\fR, journal native logging or stdout/stderr logging) is collected and processed by an instance of the \&\f(CW\*(C`systemd\-journald@.service\*(C'\fR template unit, which manages the specified namespace. The log data is stored in a data store independent from the default log namespace's data store. See \&\fBsystemd\-journald.service\fR\|(8) for details about journal namespaces. .PP Internally, journal namespaces are implemented through Linux mount namespacing and over-mounting the directory that contains the relevant \f(CW\*(C`AF_UNIX\*(C'\fR sockets used for logging in the unit's mount namespace. Since mount namespaces are used this setting disconnects propagation of mounts from the unit's processes to the host, similar to how \&\f(CW\*(C`ReadOnlyPaths\*(C'\fR and similar settings (see above) work. Journal namespaces may hence not be used for services that need to establish mount points on the host. .PP When this option is used the unit will automatically gain ordering and requirement dependencies on the two socket units associated with the \f(CW\*(C`systemd\-journald@.service\*(C'\fR instance so that they are automatically established prior to the unit starting up. Note that when this option is used log output of this service does not appear in the regular \&\fBjournalctl\fR\|(1) output, unless the \f(CW\*(C`\-\-namespace=\*(C'\fR option is used. \fI Optional. Type uniline. \fR .SS "SyslogIdentifier" .IX Subsection "SyslogIdentifier" Sets the process name (\*(L"syslog tag\*(R") to prefix log lines sent to the logging system or the kernel log buffer with. If not set, defaults to the process name of the executed process. This option is only useful when \f(CW\*(C`StandardOutput\*(C'\fR or \&\f(CW\*(C`StandardError\*(C'\fR are set to \f(CW\*(C`journal\*(C'\fR or \f(CW\*(C`kmsg\*(C'\fR (or to the same settings in combination with \f(CW\*(C`+console\*(C'\fR) and only applies to log messages written to stdout or stderr. \fI Optional. Type uniline. \fR .SS "SyslogFacility" .IX Subsection "SyslogFacility" Sets the syslog facility identifier to use when logging. One of \&\f(CW\*(C`kern\*(C'\fR, \f(CW\*(C`user\*(C'\fR, \f(CW\*(C`mail\*(C'\fR, \f(CW\*(C`daemon\*(C'\fR, \&\f(CW\*(C`auth\*(C'\fR, \f(CW\*(C`syslog\*(C'\fR, \f(CW\*(C`lpr\*(C'\fR, \f(CW\*(C`news\*(C'\fR, \&\f(CW\*(C`uucp\*(C'\fR, \f(CW\*(C`cron\*(C'\fR, \f(CW\*(C`authpriv\*(C'\fR, \f(CW\*(C`ftp\*(C'\fR, \&\f(CW\*(C`local0\*(C'\fR, \f(CW\*(C`local1\*(C'\fR, \f(CW\*(C`local2\*(C'\fR, \f(CW\*(C`local3\*(C'\fR, \&\f(CW\*(C`local4\*(C'\fR, \f(CW\*(C`local5\*(C'\fR, \f(CW\*(C`local6\*(C'\fR or \&\f(CW\*(C`local7\*(C'\fR. See \fBsyslog\fR\|(3) for details. This option is only useful when \f(CW\*(C`StandardOutput\*(C'\fR or \&\f(CW\*(C`StandardError\*(C'\fR are set to \f(CW\*(C`journal\*(C'\fR or \f(CW\*(C`kmsg\*(C'\fR (or to the same settings in combination with \f(CW\*(C`+console\*(C'\fR), and only applies to log messages written to stdout or stderr. Defaults to \f(CW\*(C`daemon\*(C'\fR. \fI Optional. Type uniline. \fR .SS "SyslogLevel" .IX Subsection "SyslogLevel" The default syslog log level to use when logging to the logging system or the kernel log buffer. One of \f(CW\*(C`emerg\*(C'\fR, \f(CW\*(C`alert\*(C'\fR, \f(CW\*(C`crit\*(C'\fR, \&\f(CW\*(C`err\*(C'\fR, \f(CW\*(C`warning\*(C'\fR, \f(CW\*(C`notice\*(C'\fR, \f(CW\*(C`info\*(C'\fR, \&\f(CW\*(C`debug\*(C'\fR. See \fBsyslog\fR\|(3) for details. This option is only useful when \f(CW\*(C`StandardOutput\*(C'\fR or \&\f(CW\*(C`StandardError\*(C'\fR are set to \f(CW\*(C`journal\*(C'\fR or \&\f(CW\*(C`kmsg\*(C'\fR (or to the same settings in combination with \f(CW\*(C`+console\*(C'\fR), and only applies to log messages written to stdout or stderr. Note that individual lines output by executed processes may be prefixed with a different log level which can be used to override the default log level specified here. The interpretation of these prefixes may be disabled with \f(CW\*(C`SyslogLevelPrefix\*(C'\fR, see below. For details, see \fBsd\-daemon\fR\|(3). Defaults to \f(CW\*(C`info\*(C'\fR. \fI Optional. Type uniline. \fR .SS "SyslogLevelPrefix" .IX Subsection "SyslogLevelPrefix" Takes a boolean argument. If true and \f(CW\*(C`StandardOutput\*(C'\fR or \&\f(CW\*(C`StandardError\*(C'\fR are set to \f(CW\*(C`journal\*(C'\fR or \f(CW\*(C`kmsg\*(C'\fR (or to the same settings in combination with \f(CW\*(C`+console\*(C'\fR), log lines written by the executed process that are prefixed with a log level will be processed with this log level set but the prefix removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are passed on as-is. This only applies to log messages written to stdout or stderr. For details about this prefixing see \&\fBsd\-daemon\fR\|(3). Defaults to true. \fI Optional. Type boolean. \fR .SS "TTYPath" .IX Subsection "TTYPath" Sets the terminal device node to use if standard input, output, or error are connected to a \s-1TTY\s0 (see above). Defaults to \f(CW\*(C`/dev/console\*(C'\fR. \fI Optional. Type uniline. \fR .SS "TTYReset" .IX Subsection "TTYReset" Reset the terminal device specified with \f(CW\*(C`TTYPath\*(C'\fR before and after execution. Defaults to \f(CW\*(C`no\*(C'\fR. \fI Optional. Type uniline. \fR .SS "TTYVHangup" .IX Subsection "TTYVHangup" Disconnect all clients which have opened the terminal device specified with \&\f(CW\*(C`TTYPath\*(C'\fR before and after execution. Defaults to \f(CW\*(C`no\*(C'\fR. \fI Optional. Type uniline. \fR .SS "TTYVTDisallocate" .IX Subsection "TTYVTDisallocate" If the terminal device specified with \f(CW\*(C`TTYPath\*(C'\fR is a virtual console terminal, try to deallocate the \s-1TTY\s0 before and after execution. This ensures that the screen and scrollback buffer is cleared. Defaults to \f(CW\*(C`no\*(C'\fR. \fI Optional. Type uniline. \fR .SS "LoadCredential" .IX Subsection "LoadCredential" Pass a credential to the unit. Credentials are limited-size binary or textual objects that may be passed to unit processes. They are primarily used for passing cryptographic keys (both public and private) or certificates, user account information or identity information from host to services. The data is accessible from the unit's processes via the file system, at a read-only location that (if possible and permitted) is backed by non-swappable memory. The data is only accessible to the user associated with the unit, via the \&\f(CW\*(C`User\*(C'\fR/\f(CW\*(C`DynamicUser\*(C'\fR settings (as well as the superuser). When available, the location of credentials is exported as the \f(CW$CREDENTIALS_DIRECTORY\fR environment variable to the unit's processes. .PP The \f(CW\*(C`LoadCredential\*(C'\fR setting takes a textual \s-1ID\s0 to use as name for a credential plus a file system path. The \s-1ID\s0 must be a short \s-1ASCII\s0 string suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path is absolute it is opened as regular file and the credential data is read from it. If the absolute path refers to an \&\f(CW\*(C`AF_UNIX\*(C'\fR stream socket in the file system a connection is made to it (only once at unit start-up) and the credential data read from the connection, providing an easy \s-1IPC\s0 integration point for dynamically providing credentials from other services. If the specified path is not absolute and itself qualifies as valid credential identifier it is understood to refer to a credential that the service manager itself received via the \f(CW$CREDENTIALS_DIRECTORY\fR environment variable, which may be used to propagate credentials from an invoking environment (e.g. a container manager that invoked the service manager) into a service. The contents of the file/socket may be arbitrary binary or textual data, including newline characters and \f(CW\*(C`NUL\*(C'\fR bytes. This option may be used multiple times, each time defining an additional credential to pass to the unit. .PP The credential files/IPC sockets must be accessible to the service manager, but don't have to be directly accessible to the unit's processes: the credential data is read and copied into separate, read-only copies for the unit that are accessible to appropriately privileged processes. This is particularly useful in combination with \f(CW\*(C`DynamicUser\*(C'\fR as this way privileged data can be made available to processes running under a dynamic \s-1UID\s0 (i.e. not a previously known one) without having to open up access to all users. .PP In order to reference the path a credential may be read from within a \&\f(CW\*(C`ExecStart\*(C'\fR command line use \f(CW\*(C`${CREDENTIALS_DIRECTORY}/mycred\*(C'\fR, e.g. \f(CW\*(C`ExecStart=cat ${CREDENTIALS_DIRECTORY}/mycred\*(C'\fR. .PP Currently, an accumulated credential size limit of 1M bytes per unit is enforced. .PP If referencing an \f(CW\*(C`AF_UNIX\*(C'\fR stream socket to connect to, the connection will originate from an abstract namespace socket, that includes information about the unit and the credential \s-1ID\s0 in its socket name. Use \fBgetpeername\fR\|(2) to query this information. The returned socket name is formatted as \f(CW\*(C`NUL\*(C'\fR\s-1RANDOM\s0 \f(CW\*(C`/unit/\*(C'\fR \s-1UNIT\s0\f(CW\*(C`/\*(C'\fR \s-1ID,\s0 i.e. a \f(CW\*(C`NUL\*(C'\fR byte (as required for abstract namespace socket names), followed by a random string (consisting of alphadecimal characters), followed by the literal string \f(CW\*(C`/unit/\*(C'\fR, followed by the requesting unit name, followed by the literal character \f(CW\*(C`/\*(C'\fR, followed by the textual credential \&\s-1ID\s0 requested. Example: \f(CW\*(C`\e0adf9d86b6eda275e/unit/foobar.service/credx\*(C'\fR in case the credential \f(CW\*(C`credx\*(C'\fR is requested for a unit \f(CW\*(C`foobar.service\*(C'\fR. This functionality is useful for using a single listening socket to serve credentials to multiple consumers. \fI Optional. Type uniline. \fR .SS "SetCredential" .IX Subsection "SetCredential" The \f(CW\*(C`SetCredential\*(C'\fR setting is similar to \&\f(CW\*(C`LoadCredential\*(C'\fR but accepts a literal value to use as data for the credential, instead of a file system path to read the data from. Do not use this option for data that is supposed to be secret, as it is accessible to unprivileged processes via \s-1IPC.\s0 It's only safe to use this for user IDs, public key material and similar non-sensitive data. For everything else use \&\f(CW\*(C`LoadCredential\*(C'\fR. In order to embed binary data into the credential data use C\-style escaping (i.e. \f(CW\*(C`\en\*(C'\fR to embed a newline, or \f(CW\*(C`\ex00\*(C'\fR to embed a \f(CW\*(C`NUL\*(C'\fR byte). .PP If a credential of the same \s-1ID\s0 is listed in both \f(CW\*(C`LoadCredential\*(C'\fR and \&\f(CW\*(C`SetCredential\*(C'\fR, the latter will act as default if the former cannot be retrieved. In this case not being able to retrieve the credential from the path specified in \&\f(CW\*(C`LoadCredential\*(C'\fR is not considered fatal. \fI Optional. Type uniline. \fR .SS "UtmpIdentifier" .IX Subsection "UtmpIdentifier" Takes a four character identifier string for an \fButmp\fR\|(5) and wtmp entry for this service. This should only be set for services such as getty implementations (such as \fBagetty\fR\|(8)) where utmp/wtmp entries must be created and cleared before and after execution, or for services that shall be executed as if they were run by a getty process (see below). If the configured string is longer than four characters, it is truncated and the terminal four characters are used. This setting interprets \f(CW%I\fR style string replacements. This setting is unset by default, i.e. no utmp/wtmp entries are created or cleaned up for this service. \fI Optional. Type uniline. \fR .SS "UtmpMode" .IX Subsection "UtmpMode" Takes one of \f(CW\*(C`init\*(C'\fR, \f(CW\*(C`login\*(C'\fR or \f(CW\*(C`user\*(C'\fR. If \&\f(CW\*(C`UtmpIdentifier\*(C'\fR is set, controls which type of \fButmp\fR\|(5)/wtmp entries for this service are generated. This setting has no effect unless \f(CW\*(C`UtmpIdentifier\*(C'\fR is set too. If \f(CW\*(C`init\*(C'\fR is set, only an \f(CW\*(C`INIT_PROCESS\*(C'\fR entry is generated and the invoked process must implement a getty-compatible utmp/wtmp logic. If \&\f(CW\*(C`login\*(C'\fR is set, first an \f(CW\*(C`INIT_PROCESS\*(C'\fR entry, followed by a \&\f(CW\*(C`LOGIN_PROCESS\*(C'\fR entry is generated. In this case, the invoked process must implement a \&\fBlogin\fR\|(1)\-compatible utmp/wtmp logic. If \f(CW\*(C`user\*(C'\fR is set, first an \f(CW\*(C`INIT_PROCESS\*(C'\fR entry, then a \&\f(CW\*(C`LOGIN_PROCESS\*(C'\fR entry and finally a \f(CW\*(C`USER_PROCESS\*(C'\fR entry is generated. In this case, the invoked process may be any process that is suitable to be run as session leader. Defaults to \f(CW\*(C`init\*(C'\fR. \fI Optional. Type enum. choice: 'init', 'login', 'user'. \fR .SS "KillMode" .IX Subsection "KillMode" Specifies how processes of this unit shall be killed. One of \&\f(CW\*(C`control\-group\*(C'\fR, \f(CW\*(C`mixed\*(C'\fR, \f(CW\*(C`process\*(C'\fR, \&\f(CW\*(C`none\*(C'\fR. .PP If set to \f(CW\*(C`control\-group\*(C'\fR, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with \f(CW\*(C`ExecStop\*(C'\fR). If set to \f(CW\*(C`mixed\*(C'\fR, the \&\f(CW\*(C`SIGTERM\*(C'\fR signal (see below) is sent to the main process while the subsequent \&\f(CW\*(C`SIGKILL\*(C'\fR signal (see below) is sent to all remaining processes of the unit's control group. If set to \f(CW\*(C`process\*(C'\fR, only the main process itself is killed (not recommended!). If set to \f(CW\*(C`none\*(C'\fR, no process is killed (strongly recommended against!). In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless empty. .PP Note that it is not recommended to set \f(CW\*(C`KillMode\*(C'\fR to \&\f(CW\*(C`process\*(C'\fR or even \f(CW\*(C`none\*(C'\fR, as this allows processes to escape the service manager's lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources. .PP Processes will first be terminated via \f(CW\*(C`SIGTERM\*(C'\fR (unless the signal to send is changed via \f(CW\*(C`KillSignal\*(C'\fR or \f(CW\*(C`RestartKillSignal\*(C'\fR). Optionally, this is immediately followed by a \f(CW\*(C`SIGHUP\*(C'\fR (if enabled with \&\f(CW\*(C`SendSIGHUP\*(C'\fR). If processes still remain after the main process of a unit has exited or the delay configured via the \f(CW\*(C`TimeoutStopSec\*(C'\fR has passed, the termination request is repeated with the \f(CW\*(C`SIGKILL\*(C'\fR signal or the signal specified via \&\f(CW\*(C`FinalKillSignal\*(C'\fR (unless this is disabled via the \f(CW\*(C`SendSIGKILL\*(C'\fR option). See \fBkill\fR\|(2) for more information. .PP Defaults to \f(CW\*(C`control\-group\*(C'\fR. \fI Optional. Type uniline. \fR .SS "KillSignal" .IX Subsection "KillSignal" Specifies which signal to use when stopping a service. This controls the signal that is sent as first step of shutting down a unit (see above), and is usually followed by \&\f(CW\*(C`SIGKILL\*(C'\fR (see above and below). For a list of valid signals, see \&\fBsignal\fR\|(7). Defaults to \f(CW\*(C`SIGTERM\*(C'\fR. .PP Note that, right after sending the signal specified in this setting, systemd will always send \&\f(CW\*(C`SIGCONT\*(C'\fR, to ensure that even suspended tasks can be terminated cleanly. \fI Optional. Type uniline. \fR .SS "RestartKillSignal" .IX Subsection "RestartKillSignal" Specifies which signal to use when restarting a service. The same as \&\f(CW\*(C`KillSignal\*(C'\fR described above, with the exception that this setting is used in a restart job. Not set by default, and the value of \f(CW\*(C`KillSignal\*(C'\fR is used. \fI Optional. Type uniline. \fR .SS "SendSIGHUP" .IX Subsection "SendSIGHUP" Specifies whether to send \&\f(CW\*(C`SIGHUP\*(C'\fR to remaining processes immediately after sending the signal configured with \&\f(CW\*(C`KillSignal\*(C'\fR. This is useful to indicate to shells and shell-like programs that their connection has been severed. Takes a boolean value. Defaults to \*(L"no\*(R". \&\fI Optional. Type boolean. \fR .SS "SendSIGKILL" .IX Subsection "SendSIGKILL" Specifies whether to send \&\f(CW\*(C`SIGKILL\*(C'\fR (or the signal specified by \&\f(CW\*(C`FinalKillSignal\*(C'\fR) to remaining processes after a timeout, if the normal shutdown procedure left processes of the service around. When disabled, a \&\f(CW\*(C`KillMode\*(C'\fR of \f(CW\*(C`control\-group\*(C'\fR or \f(CW\*(C`mixed\*(C'\fR service will not restart if processes from prior services exist within the control group. Takes a boolean value. Defaults to \*(L"yes\*(R". \&\fI Optional. Type boolean. \fR .SS "FinalKillSignal" .IX Subsection "FinalKillSignal" Specifies which signal to send to remaining processes after a timeout if \f(CW\*(C`SendSIGKILL\*(C'\fR is enabled. The signal configured here should be one that is not typically caught and processed by services (\f(CW\*(C`SIGTERM\*(C'\fR is not suitable). Developers can find it useful to use this to generate a coredump to troubleshoot why a service did not terminate upon receiving the initial \f(CW\*(C`SIGTERM\*(C'\fR signal. This can be achieved by configuring \f(CW\*(C`LimitCORE\*(C'\fR and setting \f(CW\*(C`FinalKillSignal\*(C'\fR to either \&\f(CW\*(C`SIGQUIT\*(C'\fR or \f(CW\*(C`SIGABRT\*(C'\fR. Defaults to \f(CW\*(C`SIGKILL\*(C'\fR. \&\fI Optional. Type uniline. \fR .SS "WatchdogSignal" .IX Subsection "WatchdogSignal" Specifies which signal to use to terminate the service when the watchdog timeout expires (enabled through \&\f(CW\*(C`WatchdogSec\*(C'\fR). Defaults to \f(CW\*(C`SIGABRT\*(C'\fR. \&\fI Optional. Type uniline. \fR .SS "Type" .IX Subsection "Type" Configures the process start-up type for this service unit. One of \f(CW\*(C`simple\*(C'\fR, \&\f(CW\*(C`exec\*(C'\fR, \f(CW\*(C`forking\*(C'\fR, \f(CW\*(C`oneshot\*(C'\fR, \f(CW\*(C`dbus\*(C'\fR, \&\f(CW\*(C`notify\*(C'\fR or \f(CW\*(C`idle\*(C'\fR: .PP It is generally recommended to use \f(CW\*(C`Type\*(C'\fR\f(CW\*(C`simple\*(C'\fR for long-running services whenever possible, as it is the simplest and fastest option. However, as this service type won't propagate service start-up failures and doesn't allow ordering of other units against completion of initialization of the service (which for example is useful if clients need to connect to the service through some form of \s-1IPC,\s0 and the \s-1IPC\s0 channel is only established by the service itself X in contrast to doing this ahead of time through socket or bus activation or similar), it might not be sufficient for many cases. If so, \&\f(CW\*(C`notify\*(C'\fR or \f(CW\*(C`dbus\*(C'\fR (the latter only in case the service provides a D\-Bus interface) are the preferred options as they allow service program code to precisely schedule when to consider the service started up successfully and when to proceed with follow-up units. The \&\f(CW\*(C`notify\*(C'\fR service type requires explicit support in the service codebase (as \&\fBsd_notify()\fR or an equivalent \s-1API\s0 needs to be invoked by the service at the appropriate time) X if it's not supported, then \f(CW\*(C`forking\*(C'\fR is an alternative: it supports the traditional \&\s-1UNIX\s0 service start-up protocol. Finally, \f(CW\*(C`exec\*(C'\fR might be an option for cases where it is enough to ensure the service binary is invoked, and where the service binary itself executes no or little initialization on its own (and its initialization is unlikely to fail). Note that using any type other than \&\f(CW\*(C`simple\*(C'\fR possibly delays the boot process, as the service manager needs to wait for service initialization to complete. It is hence recommended not to needlessly use any types other than \&\f(CW\*(C`simple\*(C'\fR. (Also note it is generally not recommended to use \f(CW\*(C`idle\*(C'\fR or \&\f(CW\*(C`oneshot\*(C'\fR for long-running services.) \fI Optional. Type uniline. \fR .SS "RemainAfterExit" .IX Subsection "RemainAfterExit" Takes a boolean value that specifies whether the service shall be considered active even when all its processes exited. Defaults to \f(CW\*(C`no\*(C'\fR. \fI Optional. Type boolean. \fR .SS "GuessMainPID" .IX Subsection "GuessMainPID" Takes a boolean value that specifies whether systemd should try to guess the main \s-1PID\s0 of a service if it cannot be determined reliably. This option is ignored unless \&\f(CW\*(C`Type=forking\*(C'\fR is set and \&\f(CW\*(C`PIDFile\*(C'\fR is unset because for the other types or with an explicitly configured \s-1PID\s0 file, the main \s-1PID\s0 is always known. The guessing algorithm might come to incorrect conclusions if a daemon consists of more than one process. If the main \s-1PID\s0 cannot be determined, failure detection and automatic restarting of a service will not work reliably. Defaults to \f(CW\*(C`yes\*(C'\fR. \fI Optional. Type boolean. \fR .SS "PIDFile" .IX Subsection "PIDFile" Takes a path referring to the \s-1PID\s0 file of the service. Usage of this option is recommended for services where \f(CW\*(C`Type\*(C'\fR is set to \f(CW\*(C`forking\*(C'\fR. The path specified typically points to a file below \f(CW\*(C`/run/\*(C'\fR. If a relative path is specified it is hence prefixed with \&\f(CW\*(C`/run/\*(C'\fR. The service manager will read the \s-1PID\s0 of the main process of the service from this file after start-up of the service. The service manager will not write to the file configured here, although it will remove the file after the service has shut down if it still exists. The \s-1PID\s0 file does not need to be owned by a privileged user, but if it is owned by an unprivileged user additional safety restrictions are enforced: the file may not be a symlink to a file owned by a different user (neither directly nor indirectly), and the \&\s-1PID\s0 file must refer to a process already belonging to the service. \fI Optional. Type uniline. \fR .SS "BusName" .IX Subsection "BusName" Takes a D\-Bus destination name that this service shall use. This option is mandatory for services where \f(CW\*(C`Type\*(C'\fR is set to \f(CW\*(C`dbus\*(C'\fR. It is recommended to always set this property if known to make it easy to map the service name to the D\-Bus destination. In particular, systemctl service\-log\-level/service\-log\-target verbs make use of this. \fI Optional. Type uniline. \fR .SS "ExecStart" .IX Subsection "ExecStart" Commands with their arguments that are executed when this service is started. The value is split into zero or more command lines according to the rules described below (see section \*(L"Command Lines\*(R" below). .PP Unless \f(CW\*(C`Type\*(C'\fR is \f(CW\*(C`oneshot\*(C'\fR, exactly one command must be given. When \&\f(CW\*(C`Type=oneshot\*(C'\fR is used, zero or more commands may be specified. Commands may be specified by providing multiple command lines in the same directive, or alternatively, this directive may be specified more than once with the same effect. If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect. If no \f(CW\*(C`ExecStart\*(C'\fR is specified, then the service must have \f(CW\*(C`RemainAfterExit=yes\*(C'\fR and at least one \&\f(CW\*(C`ExecStop\*(C'\fR line set. (Services lacking both \f(CW\*(C`ExecStart\*(C'\fR and \&\f(CW\*(C`ExecStop\*(C'\fR are not valid.) .PP For each of the specified commands, the first argument must be either an absolute path to an executable or a simple file name without any slashes. Optionally, this filename may be prefixed with a number of special characters: .PP \&\f(CW\*(C`@\*(C'\fR, \f(CW\*(C`\-\*(C'\fR, \f(CW\*(C`:\*(C'\fR, and one of \&\f(CW\*(C`+\*(C'\fR/\f(CW\*(C`!\*(C'\fR/\f(CW\*(C`!!\*(C'\fR may be used together and they can appear in any order. However, only one of \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`!\*(C'\fR, \f(CW\*(C`!!\*(C'\fR may be used at a time. Note that these prefixes are also supported for the other command line settings, i.e. \f(CW\*(C`ExecStartPre\*(C'\fR, \f(CW\*(C`ExecStartPost\*(C'\fR, \f(CW\*(C`ExecReload\*(C'\fR, \&\f(CW\*(C`ExecStop\*(C'\fR and \f(CW\*(C`ExecStopPost\*(C'\fR. .PP If more than one command is specified, the commands are invoked sequentially in the order they appear in the unit file. If one of the commands fails (and is not prefixed with \&\f(CW\*(C`\-\*(C'\fR), other lines are not executed, and the unit is considered failed. .PP Unless \f(CW\*(C`Type=forking\*(C'\fR is set, the process started via this command line will be considered the main process of the daemon. \fI Optional. Type list of uniline. \fR .SS "ExecStartPre" .IX Subsection "ExecStartPre" Additional commands that are executed before or after the command in \f(CW\*(C`ExecStart\*(C'\fR, respectively. Syntax is the same as for \&\f(CW\*(C`ExecStart\*(C'\fR, except that multiple command lines are allowed and the commands are executed one after the other, serially. .PP If any of those commands (not prefixed with \&\f(CW\*(C`\-\*(C'\fR) fail, the rest are not executed and the unit is considered failed. .PP \&\f(CW\*(C`ExecStart\*(C'\fR commands are only run after all \f(CW\*(C`ExecStartPre\*(C'\fR commands that were not prefixed with a \f(CW\*(C`\-\*(C'\fR exit successfully. .PP \&\f(CW\*(C`ExecStartPost\*(C'\fR commands are only run after the commands specified in \&\f(CW\*(C`ExecStart\*(C'\fR have been invoked successfully, as determined by \f(CW\*(C`Type\*(C'\fR (i.e. the process has been started for \f(CW\*(C`Type=simple\*(C'\fR or \f(CW\*(C`Type=idle\*(C'\fR, the last \&\f(CW\*(C`ExecStart\*(C'\fR process exited successfully for \f(CW\*(C`Type=oneshot\*(C'\fR, the initial process exited successfully for \f(CW\*(C`Type=forking\*(C'\fR, \f(CW\*(C`READY=1\*(C'\fR is sent for \&\f(CW\*(C`Type=notify\*(C'\fR, or the \f(CW\*(C`BusName\*(C'\fR has been taken for \&\f(CW\*(C`Type=dbus\*(C'\fR). .PP Note that \f(CW\*(C`ExecStartPre\*(C'\fR may not be used to start long-running processes. All processes forked off by processes invoked via \f(CW\*(C`ExecStartPre\*(C'\fR will be killed before the next service process is run. .PP Note that if any of the commands specified in \f(CW\*(C`ExecStartPre\*(C'\fR, \&\f(CW\*(C`ExecStart\*(C'\fR, or \f(CW\*(C`ExecStartPost\*(C'\fR fail (and are not prefixed with \&\f(CW\*(C`\-\*(C'\fR, see above) or time out before the service is fully up, execution continues with commands specified in \f(CW\*(C`ExecStopPost\*(C'\fR, the commands in \f(CW\*(C`ExecStop\*(C'\fR are skipped. .PP Note that the execution of \f(CW\*(C`ExecStartPost\*(C'\fR is taken into account for the purpose of \&\f(CW\*(C`Before\*(C'\fR/\f(CW\*(C`After\*(C'\fR ordering constraints. \fI Optional. Type list of uniline. \fR .SS "ExecStartPost" .IX Subsection "ExecStartPost" Additional commands that are executed before or after the command in \f(CW\*(C`ExecStart\*(C'\fR, respectively. Syntax is the same as for \&\f(CW\*(C`ExecStart\*(C'\fR, except that multiple command lines are allowed and the commands are executed one after the other, serially. .PP If any of those commands (not prefixed with \&\f(CW\*(C`\-\*(C'\fR) fail, the rest are not executed and the unit is considered failed. .PP \&\f(CW\*(C`ExecStart\*(C'\fR commands are only run after all \f(CW\*(C`ExecStartPre\*(C'\fR commands that were not prefixed with a \f(CW\*(C`\-\*(C'\fR exit successfully. .PP \&\f(CW\*(C`ExecStartPost\*(C'\fR commands are only run after the commands specified in \&\f(CW\*(C`ExecStart\*(C'\fR have been invoked successfully, as determined by \f(CW\*(C`Type\*(C'\fR (i.e. the process has been started for \f(CW\*(C`Type=simple\*(C'\fR or \f(CW\*(C`Type=idle\*(C'\fR, the last \&\f(CW\*(C`ExecStart\*(C'\fR process exited successfully for \f(CW\*(C`Type=oneshot\*(C'\fR, the initial process exited successfully for \f(CW\*(C`Type=forking\*(C'\fR, \f(CW\*(C`READY=1\*(C'\fR is sent for \&\f(CW\*(C`Type=notify\*(C'\fR, or the \f(CW\*(C`BusName\*(C'\fR has been taken for \&\f(CW\*(C`Type=dbus\*(C'\fR). .PP Note that \f(CW\*(C`ExecStartPre\*(C'\fR may not be used to start long-running processes. All processes forked off by processes invoked via \f(CW\*(C`ExecStartPre\*(C'\fR will be killed before the next service process is run. .PP Note that if any of the commands specified in \f(CW\*(C`ExecStartPre\*(C'\fR, \&\f(CW\*(C`ExecStart\*(C'\fR, or \f(CW\*(C`ExecStartPost\*(C'\fR fail (and are not prefixed with \&\f(CW\*(C`\-\*(C'\fR, see above) or time out before the service is fully up, execution continues with commands specified in \f(CW\*(C`ExecStopPost\*(C'\fR, the commands in \f(CW\*(C`ExecStop\*(C'\fR are skipped. .PP Note that the execution of \f(CW\*(C`ExecStartPost\*(C'\fR is taken into account for the purpose of \&\f(CW\*(C`Before\*(C'\fR/\f(CW\*(C`After\*(C'\fR ordering constraints. \fI Optional. Type list of uniline. \fR .SS "ExecCondition" .IX Subsection "ExecCondition" Optional commands that are executed before the command(s) in \f(CW\*(C`ExecStartPre\*(C'\fR. Syntax is the same as for \f(CW\*(C`ExecStart\*(C'\fR, except that multiple command lines are allowed and the commands are executed one after the other, serially. .PP The behavior is like an \f(CW\*(C`ExecStartPre\*(C'\fR and condition check hybrid: when an \&\f(CW\*(C`ExecCondition\*(C'\fR command exits with exit code 1 through 254 (inclusive), the remaining commands are skipped and the unit is not marked as failed. However, if an \&\f(CW\*(C`ExecCondition\*(C'\fR command exits with 255 or abnormally (e.g. timeout, killed by a signal, etc.), the unit will be considered failed (and remaining commands will be skipped). Exit code of 0 or those matching \f(CW\*(C`SuccessExitStatus\*(C'\fR will continue execution to the next command(s). .PP The same recommendations about not running long-running processes in \f(CW\*(C`ExecStartPre\*(C'\fR also applies to \f(CW\*(C`ExecCondition\*(C'\fR. \f(CW\*(C`ExecCondition\*(C'\fR will also run the commands in \f(CW\*(C`ExecStopPost\*(C'\fR, as part of stopping the service, in the case of any non-zero or abnormal exits, like the ones described above. \fI Optional. Type list of uniline. \fR .SS "ExecReload" .IX Subsection "ExecReload" Commands to execute to trigger a configuration reload in the service. This argument takes multiple command lines, following the same scheme as described for \&\f(CW\*(C`ExecStart\*(C'\fR above. Use of this setting is optional. Specifier and environment variable substitution is supported here following the same scheme as for \&\f(CW\*(C`ExecStart\*(C'\fR. .PP One additional, special environment variable is set: if known, \f(CW$MAINPID\fR is set to the main process of the daemon, and may be used for command lines like the following: .PP Note however that reloading a daemon by sending a signal (as with the example line above) is usually not a good choice, because this is an asynchronous operation and hence not suitable to order reloads of multiple services against each other. It is strongly recommended to set \&\f(CW\*(C`ExecReload\*(C'\fR to a command that not only triggers a configuration reload of the daemon, but also synchronously waits for it to complete. For example, \&\fBdbus\-broker\fR\|(1) uses the following: \fI Optional. Type list of uniline. \fR .SS "ExecStop" .IX Subsection "ExecStop" Commands to execute to stop the service started via \&\f(CW\*(C`ExecStart\*(C'\fR. This argument takes multiple command lines, following the same scheme as described for \f(CW\*(C`ExecStart\*(C'\fR above. Use of this setting is optional. After the commands configured in this option are run, it is implied that the service is stopped, and any processes remaining for it are terminated according to the \f(CW\*(C`KillMode\*(C'\fR setting (see \&\fBsystemd.kill\fR\|(5)). If this option is not specified, the process is terminated by sending the signal specified in \&\f(CW\*(C`KillSignal\*(C'\fR or \f(CW\*(C`RestartKillSignal\*(C'\fR when service stop is requested. Specifier and environment variable substitution is supported (including \&\f(CW$MAINPID\fR, see above). .PP Note that it is usually not sufficient to specify a command for this setting that only asks the service to terminate (for example, by sending some form of termination signal to it), but does not wait for it to do so. Since the remaining processes of the services are killed according to \&\f(CW\*(C`KillMode\*(C'\fR and \f(CW\*(C`KillSignal\*(C'\fR or \&\f(CW\*(C`RestartKillSignal\*(C'\fR as described above immediately after the command exited, this may not result in a clean stop. The specified command should hence be a synchronous operation, not an asynchronous one. .PP Note that the commands specified in \f(CW\*(C`ExecStop\*(C'\fR are only executed when the service started successfully first. They are not invoked if the service was never started at all, or in case its start-up failed, for example because any of the commands specified in \f(CW\*(C`ExecStart\*(C'\fR, \&\f(CW\*(C`ExecStartPre\*(C'\fR or \f(CW\*(C`ExecStartPost\*(C'\fR failed (and weren't prefixed with \&\f(CW\*(C`\-\*(C'\fR, see above) or timed out. Use \f(CW\*(C`ExecStopPost\*(C'\fR to invoke commands when a service failed to start up correctly and is shut down again. Also note that the stop operation is always performed if the service started successfully, even if the processes in the service terminated on their own or were killed. The stop commands must be prepared to deal with that case. \f(CW$MAINPID\fR will be unset if systemd knows that the main process exited by the time the stop commands are called. .PP Service restart requests are implemented as stop operations followed by start operations. This means that \f(CW\*(C`ExecStop\*(C'\fR and \f(CW\*(C`ExecStopPost\*(C'\fR are executed during a service restart operation. .PP It is recommended to use this setting for commands that communicate with the service requesting clean termination. For post-mortem clean-up steps use \f(CW\*(C`ExecStopPost\*(C'\fR instead. \&\fI Optional. Type list of uniline. \fR .SS "ExecStopPost" .IX Subsection "ExecStopPost" Additional commands that are executed after the service is stopped. This includes cases where the commands configured in \f(CW\*(C`ExecStop\*(C'\fR were used, where the service does not have any \&\f(CW\*(C`ExecStop\*(C'\fR defined, or where the service exited unexpectedly. This argument takes multiple command lines, following the same scheme as described for \f(CW\*(C`ExecStart\*(C'\fR. Use of these settings is optional. Specifier and environment variable substitution is supported. Note that X unlike \&\f(CW\*(C`ExecStop\*(C'\fR X commands specified with this setting are invoked when a service failed to start up correctly and is shut down again. .PP It is recommended to use this setting for clean-up operations that shall be executed even when the service failed to start up correctly. Commands configured with this setting need to be able to operate even if the service failed starting up half-way and left incompletely initialized data around. As the service's processes have been terminated already when the commands specified with this setting are executed they should not attempt to communicate with them. .PP Note that all commands that are configured with this setting are invoked with the result code of the service, as well as the main process' exit code and status, set in the \f(CW$SERVICE_RESULT\fR, \&\f(CW$EXIT_CODE\fR and \f(CW$EXIT_STATUS\fR environment variables, see \&\fBsystemd.exec\fR\|(5) for details. .PP Note that the execution of \f(CW\*(C`ExecStopPost\*(C'\fR is taken into account for the purpose of \&\f(CW\*(C`Before\*(C'\fR/\f(CW\*(C`After\*(C'\fR ordering constraints. \fI Optional. Type list of uniline. \fR .SS "RestartSec" .IX Subsection "RestartSec" Configures the time to sleep before restarting a service (as configured with \f(CW\*(C`Restart\*(C'\fR). Takes a unit-less value in seconds, or a time span value such as \*(L"5min 20s\*(R". Defaults to 100ms. \fI Optional. Type uniline. \fR .SS "TimeoutStartSec" .IX Subsection "TimeoutStartSec" Configures the time to wait for start-up. If a daemon service does not signal start-up completion within the configured time, the service will be considered failed and will be shut down again. The precise action depends on the \f(CW\*(C`TimeoutStartFailureMode\*(C'\fR option. Takes a unit-less value in seconds, or a time span value such as \*(L"5min 20s\*(R". Pass \f(CW\*(C`infinity\*(C'\fR to disable the timeout logic. Defaults to \f(CW\*(C`DefaultTimeoutStartSec\*(C'\fR from the manager configuration file, except when \&\f(CW\*(C`Type=oneshot\*(C'\fR is used, in which case the timeout is disabled by default (see \&\fBsystemd\-system.conf\fR\|(5)). .PP If a service of \f(CW\*(C`Type=notify\*(C'\fR sends \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR, this may cause the start time to be extended beyond \f(CW\*(C`TimeoutStartSec\*(C'\fR. The first receipt of this message must occur before \f(CW\*(C`TimeoutStartSec\*(C'\fR is exceeded, and once the start time has extended beyond \&\f(CW\*(C`TimeoutStartSec\*(C'\fR, the service manager will allow the service to continue to start, provided the service repeats \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR within the interval specified until the service startup status is finished by \f(CW\*(C`READY=1\*(C'\fR. (see \&\fBsd_notify\fR\|(3)). \&\fI Optional. Type uniline. \fR .SS "TimeoutStopSec" .IX Subsection "TimeoutStopSec" This option serves two purposes. First, it configures the time to wait for each \&\f(CW\*(C`ExecStop\*(C'\fR command. If any of them times out, subsequent \f(CW\*(C`ExecStop\*(C'\fR commands are skipped and the service will be terminated by \f(CW\*(C`SIGTERM\*(C'\fR. If no \f(CW\*(C`ExecStop\*(C'\fR commands are specified, the service gets the \f(CW\*(C`SIGTERM\*(C'\fR immediately. This default behavior can be changed by the \f(CW\*(C`TimeoutStopFailureMode\*(C'\fR option. Second, it configures the time to wait for the service itself to stop. If it doesn't terminate in the specified time, it will be forcibly terminated by \f(CW\*(C`SIGKILL\*(C'\fR (see \f(CW\*(C`KillMode\*(C'\fR in \&\fBsystemd.kill\fR\|(5)). Takes a unit-less value in seconds, or a time span value such as \*(L"5min 20s\*(R". Pass \f(CW\*(C`infinity\*(C'\fR to disable the timeout logic. Defaults to \&\f(CW\*(C`DefaultTimeoutStopSec\*(C'\fR from the manager configuration file (see \&\fBsystemd\-system.conf\fR\|(5)). .PP If a service of \f(CW\*(C`Type=notify\*(C'\fR sends \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR, this may cause the stop time to be extended beyond \f(CW\*(C`TimeoutStopSec\*(C'\fR. The first receipt of this message must occur before \f(CW\*(C`TimeoutStopSec\*(C'\fR is exceeded, and once the stop time has extended beyond \&\f(CW\*(C`TimeoutStopSec\*(C'\fR, the service manager will allow the service to continue to stop, provided the service repeats \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR within the interval specified, or terminates itself (see \fBsd_notify\fR\|(3)). \&\fI Optional. Type uniline. \fR .SS "TimeoutAbortSec" .IX Subsection "TimeoutAbortSec" This option configures the time to wait for the service to terminate when it was aborted due to a watchdog timeout (see \f(CW\*(C`WatchdogSec\*(C'\fR). If the service has a short \f(CW\*(C`TimeoutStopSec\*(C'\fR this option can be used to give the system more time to write a core dump of the service. Upon expiration the service will be forcibly terminated by \f(CW\*(C`SIGKILL\*(C'\fR (see \f(CW\*(C`KillMode\*(C'\fR in \&\fBsystemd.kill\fR\|(5)). The core file will be truncated in this case. Use \f(CW\*(C`TimeoutAbortSec\*(C'\fR to set a sensible timeout for the core dumping per service that is large enough to write all expected data while also being short enough to handle the service failure in due time. .PP Takes a unit-less value in seconds, or a time span value such as \*(L"5min 20s\*(R". Pass an empty value to skip the dedicated watchdog abort timeout handling and fall back \f(CW\*(C`TimeoutStopSec\*(C'\fR. Pass \&\f(CW\*(C`infinity\*(C'\fR to disable the timeout logic. Defaults to \f(CW\*(C`DefaultTimeoutAbortSec\*(C'\fR from the manager configuration file (see \&\fBsystemd\-system.conf\fR\|(5)). .PP If a service of \f(CW\*(C`Type=notify\*(C'\fR handles \f(CW\*(C`SIGABRT\*(C'\fR itself (instead of relying on the kernel to write a core dump) it can send \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR to extended the abort time beyond \f(CW\*(C`TimeoutAbortSec\*(C'\fR. The first receipt of this message must occur before \f(CW\*(C`TimeoutAbortSec\*(C'\fR is exceeded, and once the abort time has extended beyond \&\f(CW\*(C`TimeoutAbortSec\*(C'\fR, the service manager will allow the service to continue to abort, provided the service repeats \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR within the interval specified, or terminates itself (see \fBsd_notify\fR\|(3)). \&\fI Optional. Type uniline. \fR .SS "TimeoutSec" .IX Subsection "TimeoutSec" A shorthand for configuring both \&\f(CW\*(C`TimeoutStartSec\*(C'\fR and \&\f(CW\*(C`TimeoutStopSec\*(C'\fR to the specified value. \&\fI Optional. Type uniline. \fR .SS "TimeoutStartFailureMode" .IX Subsection "TimeoutStartFailureMode" These options configure the action that is taken in case a daemon service does not signal start-up within its configured \f(CW\*(C`TimeoutStartSec\*(C'\fR, respectively if it does not stop within \&\f(CW\*(C`TimeoutStopSec\*(C'\fR. Takes one of \f(CW\*(C`terminate\*(C'\fR, \f(CW\*(C`abort\*(C'\fR and \&\f(CW\*(C`kill\*(C'\fR. Both options default to \f(CW\*(C`terminate\*(C'\fR. .PP If \f(CW\*(C`terminate\*(C'\fR is set the service will be gracefully terminated by sending the signal specified in \f(CW\*(C`KillSignal\*(C'\fR (defaults to \f(CW\*(C`SIGTERM\*(C'\fR, see \&\fBsystemd.kill\fR\|(5)). If the service does not terminate the \f(CW\*(C`FinalKillSignal\*(C'\fR is sent after \&\f(CW\*(C`TimeoutStopSec\*(C'\fR. If \f(CW\*(C`abort\*(C'\fR is set, \f(CW\*(C`WatchdogSignal\*(C'\fR is sent instead and \f(CW\*(C`TimeoutAbortSec\*(C'\fR applies before sending \f(CW\*(C`FinalKillSignal\*(C'\fR. This setting may be used to analyze services that fail to start-up or shut-down intermittently. By using \f(CW\*(C`kill\*(C'\fR the service is immediately terminated by sending \&\f(CW\*(C`FinalKillSignal\*(C'\fR without any further timeout. This setting can be used to expedite the shutdown of failing services. \&\fI Optional. Type enum. choice: 'terminate', 'abort', 'kill'. \fR .SS "TimeoutStopFailureMode" .IX Subsection "TimeoutStopFailureMode" These options configure the action that is taken in case a daemon service does not signal start-up within its configured \f(CW\*(C`TimeoutStartSec\*(C'\fR, respectively if it does not stop within \&\f(CW\*(C`TimeoutStopSec\*(C'\fR. Takes one of \f(CW\*(C`terminate\*(C'\fR, \f(CW\*(C`abort\*(C'\fR and \&\f(CW\*(C`kill\*(C'\fR. Both options default to \f(CW\*(C`terminate\*(C'\fR. .PP If \f(CW\*(C`terminate\*(C'\fR is set the service will be gracefully terminated by sending the signal specified in \f(CW\*(C`KillSignal\*(C'\fR (defaults to \f(CW\*(C`SIGTERM\*(C'\fR, see \&\fBsystemd.kill\fR\|(5)). If the service does not terminate the \f(CW\*(C`FinalKillSignal\*(C'\fR is sent after \&\f(CW\*(C`TimeoutStopSec\*(C'\fR. If \f(CW\*(C`abort\*(C'\fR is set, \f(CW\*(C`WatchdogSignal\*(C'\fR is sent instead and \f(CW\*(C`TimeoutAbortSec\*(C'\fR applies before sending \f(CW\*(C`FinalKillSignal\*(C'\fR. This setting may be used to analyze services that fail to start-up or shut-down intermittently. By using \f(CW\*(C`kill\*(C'\fR the service is immediately terminated by sending \&\f(CW\*(C`FinalKillSignal\*(C'\fR without any further timeout. This setting can be used to expedite the shutdown of failing services. \&\fI Optional. Type enum. choice: 'terminate', 'abort', 'kill'. \fR .SS "RuntimeMaxSec" .IX Subsection "RuntimeMaxSec" Configures a maximum time for the service to run. If this is used and the service has been active for longer than the specified time it is terminated and put into a failure state. Note that this setting does not have any effect on \f(CW\*(C`Type=oneshot\*(C'\fR services, as they terminate immediately after activation completed. Pass \f(CW\*(C`infinity\*(C'\fR (the default) to configure no runtime limit. .PP If a service of \f(CW\*(C`Type=notify\*(C'\fR sends \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR, this may cause the runtime to be extended beyond \f(CW\*(C`RuntimeMaxSec\*(C'\fR. The first receipt of this message must occur before \f(CW\*(C`RuntimeMaxSec\*(C'\fR is exceeded, and once the runtime has extended beyond \&\f(CW\*(C`RuntimeMaxSec\*(C'\fR, the service manager will allow the service to continue to run, provided the service repeats \f(CW\*(C`EXTEND_TIMEOUT_USEC=X\*(C'\fR within the interval specified until the service shutdown is achieved by \f(CW\*(C`STOPPING=1\*(C'\fR (or termination). (see \&\fBsd_notify\fR\|(3)). \&\fI Optional. Type uniline. \fR .SS "WatchdogSec" .IX Subsection "WatchdogSec" Configures the watchdog timeout for a service. The watchdog is activated when the start-up is completed. The service must call \&\fBsd_notify\fR\|(3) regularly with \f(CW\*(C`WATCHDOG=1\*(C'\fR (i.e. the \&\*(L"keep-alive ping\*(R"). If the time between two such calls is larger than the configured time, then the service is placed in a failed state and it will be terminated with \&\f(CW\*(C`SIGABRT\*(C'\fR (or the signal specified by \&\f(CW\*(C`WatchdogSignal\*(C'\fR). By setting \&\f(CW\*(C`Restart\*(C'\fR to \f(CW\*(C`on\-failure\*(C'\fR, \&\f(CW\*(C`on\-watchdog\*(C'\fR, \f(CW\*(C`on\-abnormal\*(C'\fR or \&\f(CW\*(C`always\*(C'\fR, the service will be automatically restarted. The time configured here will be passed to the executed service process in the \&\f(CW\*(C`WATCHDOG_USEC\*(C'\fR environment variable. This allows daemons to automatically enable the keep-alive pinging logic if watchdog support is enabled for the service. If this option is used, \f(CW\*(C`NotifyAccess\*(C'\fR (see below) should be set to open access to the notification socket provided by systemd. If \f(CW\*(C`NotifyAccess\*(C'\fR is not set, it will be implicitly set to \f(CW\*(C`main\*(C'\fR. Defaults to 0, which disables this feature. The service can check whether the service manager expects watchdog keep-alive notifications. See \&\fBsd_watchdog_enabled\fR\|(3) for details. \&\fBsd_event_set_watchdog\fR\|(3) may be used to enable automatic watchdog notification support. \&\fI Optional. Type uniline. \fR .SS "Restart" .IX Subsection "Restart" Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached. The service process may be the main service process, but it may also be one of the processes specified with \f(CW\*(C`ExecStartPre\*(C'\fR, \&\f(CW\*(C`ExecStartPost\*(C'\fR, \&\f(CW\*(C`ExecStop\*(C'\fR, \&\f(CW\*(C`ExecStopPost\*(C'\fR, or \&\f(CW\*(C`ExecReload\*(C'\fR. When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted. Timeouts include missing the watchdog \*(L"keep-alive ping\*(R" deadline and a service start, reload, and stop operation timeouts. .PP Takes one of \&\f(CW\*(C`no\*(C'\fR, \&\f(CW\*(C`on\-success\*(C'\fR, \&\f(CW\*(C`on\-failure\*(C'\fR, \&\f(CW\*(C`on\-abnormal\*(C'\fR, \&\f(CW\*(C`on\-watchdog\*(C'\fR, \&\f(CW\*(C`on\-abort\*(C'\fR, or \&\f(CW\*(C`always\*(C'\fR. If set to \f(CW\*(C`no\*(C'\fR (the default), the service will not be restarted. If set to \f(CW\*(C`on\-success\*(C'\fR, it will be restarted only when the service process exits cleanly. In this context, a clean exit means an exit code of 0, or one of the signals \&\f(CW\*(C`SIGHUP\*(C'\fR, \&\f(CW\*(C`SIGINT\*(C'\fR, \&\f(CW\*(C`SIGTERM\*(C'\fR or \&\f(CW\*(C`SIGPIPE\*(C'\fR, and additionally, exit statuses and signals specified in \&\f(CW\*(C`SuccessExitStatus\*(C'\fR. If set to \&\f(CW\*(C`on\-failure\*(C'\fR, the service will be restarted when the process exits with a non-zero exit code, is terminated by a signal (including on core dump, but excluding the aforementioned four signals), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered. If set to \f(CW\*(C`on\-abnormal\*(C'\fR, the service will be restarted when the process is terminated by a signal (including on core dump, excluding the aforementioned four signals), when an operation times out, or when the watchdog timeout is triggered. If set to \&\f(CW\*(C`on\-abort\*(C'\fR, the service will be restarted only if the service process exits due to an uncaught signal not specified as a clean exit status. If set to \&\f(CW\*(C`on\-watchdog\*(C'\fR, the service will be restarted only if the watchdog timeout for the service expires. If set to \f(CW\*(C`always\*(C'\fR, the service will be restarted regardless of whether it exited cleanly or not, got terminated abnormally by a signal, or hit a timeout. .PP As exceptions to the setting above, the service will not be restarted if the exit code or signal is specified in \&\f(CW\*(C`RestartPreventExitStatus\*(C'\fR (see below) or the service is stopped with systemctl stop or an equivalent operation. Also, the services will always be restarted if the exit code or signal is specified in \&\f(CW\*(C`RestartForceExitStatus\*(C'\fR (see below). .PP Note that service restart is subject to unit start rate limiting configured with \f(CW\*(C`StartLimitIntervalSec\*(C'\fR and \f(CW\*(C`StartLimitBurst\*(C'\fR, see \&\fBsystemd.unit\fR\|(5) for details. A restarted service enters the failed state only after the start limits are reached. .PP Setting this to \f(CW\*(C`on\-failure\*(C'\fR is the recommended choice for long-running services, in order to increase reliability by attempting automatic recovery from errors. For services that shall be able to terminate on their own choice (and avoid immediate restarting), \&\f(CW\*(C`on\-abnormal\*(C'\fR is an alternative choice. \fI Optional. Type enum. choice: 'no', 'on\-success', 'on\-failure', 'on\-abnormal', 'on\-watchdog', 'on\-abort', 'always'. \fR .SS "SuccessExitStatus" .IX Subsection "SuccessExitStatus" Takes a list of exit status definitions that, when returned by the main service process, will be considered successful termination, in addition to the normal successful exit status 0 and the signals \f(CW\*(C`SIGHUP\*(C'\fR, \f(CW\*(C`SIGINT\*(C'\fR, \&\f(CW\*(C`SIGTERM\*(C'\fR, and \f(CW\*(C`SIGPIPE\*(C'\fR. Exit status definitions can be numeric termination statuses, termination status names, or termination signal names, separated by spaces. See the Process Exit Codes section in \&\fBsystemd.exec\fR\|(5) for a list of termination status names (for this setting only the part without the \&\f(CW\*(C`EXIT_\*(C'\fR or \f(CW\*(C`EX_\*(C'\fR prefix should be used). See \fBsignal\fR\|(7) for a list of signal names. .PP Note that this setting does not change the mapping between numeric exit statuses and their names, i.e. regardless how this setting is used 0 will still be mapped to \f(CW\*(C`SUCCESS\*(C'\fR (and thus typically shown as \f(CW\*(C`0/SUCCESS\*(C'\fR in tool outputs) and 1 to \&\f(CW\*(C`FAILURE\*(C'\fR (and thus typically shown as \f(CW\*(C`1/FAILURE\*(C'\fR), and so on. It only controls what happens as effect of these exit statuses, and how it propagates to the state of the service as a whole. .PP This option may appear more than once, in which case the list of successful exit statuses is merged. If the empty string is assigned to this option, the list is reset, all prior assignments of this option will have no effect. .PP Note: systemd-analyze exit-status may be used to list exit statuses and translate between numerical status values and names. \fI Optional. Type uniline. \fR .SS "RestartPreventExitStatus" .IX Subsection "RestartPreventExitStatus" Takes a list of exit status definitions that, when returned by the main service process, will prevent automatic service restarts, regardless of the restart setting configured with \&\f(CW\*(C`Restart\*(C'\fR. Exit status definitions can either be numeric exit codes or termination signal names, and are separated by spaces. Defaults to the empty list, so that, by default, no exit status is excluded from the configured restart logic. For example: .PP .Vb 1 \& RestartPreventExitStatus=1 6 SIGABRT .Ve .PP ensures that exit codes 1 and 6 and the termination signal \f(CW\*(C`SIGABRT\*(C'\fR will not result in automatic service restarting. This option may appear more than once, in which case the list of restart-preventing statuses is merged. If the empty string is assigned to this option, the list is reset and all prior assignments of this option will have no effect. .PP Note that this setting has no effect on processes configured via \&\f(CW\*(C`ExecStartPre\*(C'\fR, \f(CW\*(C`ExecStartPost\*(C'\fR, \f(CW\*(C`ExecStop\*(C'\fR, \&\f(CW\*(C`ExecStopPost\*(C'\fR or \f(CW\*(C`ExecReload\*(C'\fR, but only on the main service process, i.e. either the one invoked by \f(CW\*(C`ExecStart\*(C'\fR or (depending on \&\f(CW\*(C`Type\*(C'\fR, \f(CW\*(C`PIDFile\*(C'\fR, X) the otherwise configured main process. \fI Optional. Type uniline. \fR .SS "RestartForceExitStatus" .IX Subsection "RestartForceExitStatus" Takes a list of exit status definitions that, when returned by the main service process, will force automatic service restarts, regardless of the restart setting configured with \f(CW\*(C`Restart\*(C'\fR. The argument format is similar to \&\f(CW\*(C`RestartPreventExitStatus\*(C'\fR. \fI Optional. Type uniline. \fR .SS "RootDirectoryStartOnly" .IX Subsection "RootDirectoryStartOnly" Takes a boolean argument. If true, the root directory, as configured with the \&\f(CW\*(C`RootDirectory\*(C'\fR option (see \&\fBsystemd.exec\fR\|(5) for more information), is only applied to the process started with \f(CW\*(C`ExecStart\*(C'\fR, and not to the various other \f(CW\*(C`ExecStartPre\*(C'\fR, \&\f(CW\*(C`ExecStartPost\*(C'\fR, \&\f(CW\*(C`ExecReload\*(C'\fR, \f(CW\*(C`ExecStop\*(C'\fR, and \f(CW\*(C`ExecStopPost\*(C'\fR commands. If false, the setting is applied to all configured commands the same way. Defaults to false. \fI Optional. Type boolean. \fR .SS "NonBlocking" .IX Subsection "NonBlocking" Set the \f(CW\*(C`O_NONBLOCK\*(C'\fR flag for all file descriptors passed via socket-based activation. If true, all file descriptors >= 3 (i.e. all except stdin, stdout, stderr), excluding those passed in via the file descriptor storage logic (see \f(CW\*(C`FileDescriptorStoreMax\*(C'\fR for details), will have the \f(CW\*(C`O_NONBLOCK\*(C'\fR flag set and hence are in non-blocking mode. This option is only useful in conjunction with a socket unit, as described in \&\fBsystemd.socket\fR\|(5) and has no effect on file descriptors which were previously saved in the file-descriptor store for example. Defaults to false. \fI Optional. Type uniline. \fR .SS "NotifyAccess" .IX Subsection "NotifyAccess" Controls access to the service status notification socket, as accessible via the \&\fBsd_notify\fR\|(3) call. Takes one of \f(CW\*(C`none\*(C'\fR (the default), \f(CW\*(C`main\*(C'\fR, \f(CW\*(C`exec\*(C'\fR or \&\f(CW\*(C`all\*(C'\fR. If \f(CW\*(C`none\*(C'\fR, no daemon status updates are accepted from the service processes, all status update messages are ignored. If \f(CW\*(C`main\*(C'\fR, only service updates sent from the main process of the service are accepted. If \f(CW\*(C`exec\*(C'\fR, only service updates sent from any of the main or control processes originating from one of the \f(CW\*(C`Exec*=\*(C'\fR commands are accepted. If \&\f(CW\*(C`all\*(C'\fR, all services updates from all members of the service's control group are accepted. This option should be set to open access to the notification socket when using \f(CW\*(C`Type=notify\*(C'\fR or \&\f(CW\*(C`WatchdogSec\*(C'\fR (see above). If those options are used but \f(CW\*(C`NotifyAccess\*(C'\fR is not configured, it will be implicitly set to \f(CW\*(C`main\*(C'\fR. .PP Note that \fBsd_notify()\fR notifications may be attributed to units correctly only if either the sending process is still around at the time \s-1PID 1\s0 processes the message, or if the sending process is explicitly runtime-tracked by the service manager. The latter is the case if the service manager originally forked off the process, i.e. on all processes that match \f(CW\*(C`main\*(C'\fR or \&\f(CW\*(C`exec\*(C'\fR. Conversely, if an auxiliary process of the unit sends an \&\fBsd_notify()\fR message and immediately exits, the service manager might not be able to properly attribute the message to the unit, and thus will ignore it, even if \&\f(CW\*(C`NotifyAccess\*(C'\fR\f(CW\*(C`all\*(C'\fR is set for it. .PP Hence, to eliminate all race conditions involving lookup of the client's unit and attribution of notifications to units correctly, \fBsd_notify_barrier()\fR may be used. This call acts as a synchronization point and ensures all notifications sent before this call have been picked up by the service manager when it returns successfully. Use of \fBsd_notify_barrier()\fR is needed for clients which are not invoked by the service manager, otherwise this synchronization mechanism is unnecessary for attribution of notifications to the unit. \fI Optional. Type enum. choice: 'none', 'main', 'exec', 'all'. \fR .SS "Sockets" .IX Subsection "Sockets" Specifies the name of the socket units this service shall inherit socket file descriptors from when the service is started. Normally, it should not be necessary to use this setting, as all socket file descriptors whose unit shares the same name as the service (subject to the different unit name suffix of course) are passed to the spawned process. .PP Note that the same socket file descriptors may be passed to multiple processes simultaneously. Also note that a different service may be activated on incoming socket traffic than the one which is ultimately configured to inherit the socket file descriptors. Or, in other words: the \&\f(CW\*(C`Service\*(C'\fR setting of \&\f(CW\*(C`.socket\*(C'\fR units does not have to match the inverse of the \f(CW\*(C`Sockets\*(C'\fR setting of the \&\f(CW\*(C`.service\*(C'\fR it refers to. .PP This option may appear more than once, in which case the list of socket units is merged. Note that once set, clearing the list of sockets again (for example, by assigning the empty string to this option) is not supported. \fI Optional. Type uniline. \fR .SS "FileDescriptorStoreMax" .IX Subsection "FileDescriptorStoreMax" Configure how many file descriptors may be stored in the service manager for the service using \&\fBsd_pid_notify_with_fds\fR\|(3)'s \&\f(CW\*(C`FDSTORE=1\*(C'\fR messages. This is useful for implementing services that can restart after an explicit request or a crash without losing state. Any open sockets and other file descriptors which should not be closed during the restart may be stored this way. Application state can either be serialized to a file in \f(CW\*(C`/run/\*(C'\fR, or better, stored in a \&\fBmemfd_create\fR\|(2) memory file descriptor. Defaults to 0, i.e. no file descriptors may be stored in the service manager. All file descriptors passed to the service manager from a specific service are passed back to the service's main process on the next service restart (see \&\fBsd_listen_fds\fR\|(3) for details about the precise protocol used and the order in which the file descriptors are passed). Any file descriptors passed to the service manager are automatically closed when \&\f(CW\*(C`POLLHUP\*(C'\fR or \f(CW\*(C`POLLERR\*(C'\fR is seen on them, or when the service is fully stopped and no job is queued or being executed for it. If this option is used, \&\f(CW\*(C`NotifyAccess\*(C'\fR (see above) should be set to open access to the notification socket provided by systemd. If \f(CW\*(C`NotifyAccess\*(C'\fR is not set, it will be implicitly set to \&\f(CW\*(C`main\*(C'\fR. \fI Optional. Type uniline. \fR .SS "USBFunctionDescriptors" .IX Subsection "USBFunctionDescriptors" Configure the location of a file containing \&\s-1USB\s0 FunctionFS descriptors, for implementation of \s-1USB\s0 gadget functions. This is used only in conjunction with a socket unit with \f(CW\*(C`ListenUSBFunction\*(C'\fR configured. The contents of this file are written to the \&\f(CW\*(C`ep0\*(C'\fR file after it is opened. \fI Optional. Type uniline. \fR .SS "USBFunctionStrings" .IX Subsection "USBFunctionStrings" Configure the location of a file containing \&\s-1USB\s0 FunctionFS strings. Behavior is similar to \&\f(CW\*(C`USBFunctionDescriptors\*(C'\fR above. \fI Optional. Type uniline. \fR .SS "OOMPolicy" .IX Subsection "OOMPolicy" Configure the Out-Of-Memory (\s-1OOM\s0) killer policy. On Linux, when memory becomes scarce the kernel might decide to kill a running process in order to free up memory and reduce memory pressure. This setting takes one of \f(CW\*(C`continue\*(C'\fR, \f(CW\*(C`stop\*(C'\fR or \&\f(CW\*(C`kill\*(C'\fR. If set to \f(CW\*(C`continue\*(C'\fR and a process of the service is killed by the kernel's \s-1OOM\s0 killer this is logged but the service continues running. If set to \&\f(CW\*(C`stop\*(C'\fR the event is logged but the service is terminated cleanly by the service manager. If set to \f(CW\*(C`kill\*(C'\fR and one of the service's processes is killed by the \s-1OOM\s0 killer the kernel is instructed to kill all remaining processes of the service, too. Defaults to the setting \f(CW\*(C`DefaultOOMPolicy\*(C'\fR in \&\fBsystemd\-system.conf\fR\|(5) is set to, except for services where \f(CW\*(C`Delegate\*(C'\fR is turned on, where it defaults to \&\f(CW\*(C`continue\*(C'\fR. .PP Use the \f(CW\*(C`OOMScoreAdjust\*(C'\fR setting to configure whether processes of the unit shall be considered preferred or less preferred candidates for process termination by the Linux \s-1OOM\s0 killer logic. See \&\fBsystemd.exec\fR\|(5) for details. \fI Optional. Type uniline. \fR .SS "FailureAction" .IX Subsection "FailureAction" \&\fBDeprecated\fR \fI Optional. Type uniline. \fR .SS "SuccessAction" .IX Subsection "SuccessAction" \&\fBDeprecated\fR \fI Optional. Type uniline. \fR .SS "StartLimitBurst" .IX Subsection "StartLimitBurst" \&\fBDeprecated\fR \fI Optional. Type uniline. \fR .SS "StartLimitInterval" .IX Subsection "StartLimitInterval" \&\fBDeprecated\fR \fI Optional. Type uniline. \fR .SS "RebootArgument" .IX Subsection "RebootArgument" \&\fBDeprecated\fR \fI Optional. Type uniline. \fR .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 cme .SH "COPYRIGHT" .IX Header "COPYRIGHT" .IP "2010\-2016 Lennart Poettering and others" 4 .IX Item "2010-2016 Lennart Poettering and others" .PD 0 .IP "2016 Dominique Dumont" 4 .IX Item "2016 Dominique Dumont" .PD .SH "LICENSE" .IX Header "LICENSE" .IP "LGPLv2.1+" 4 .IX Item "LGPLv2.1+"