X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=man%2Fsystemd.service.xml;h=da9079cbb8dfe37aafeae9c534711e7eeb50af0b;hp=a82dfb2c86496c11eb14f702ec0ece5c7f16b62a;hb=85a8eeee36b57c1ab382b0225fa9a87525bbeee9;hpb=501996231293506a85bf4d610938a655ddc8cb92 diff --git a/man/systemd.service.xml b/man/systemd.service.xml index a82dfb2c8..da9079cbb 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -301,16 +301,15 @@ as. This option is mandatory for services where Type= is set to - , but its use - is otherwise recommended if the process - takes a name on the D-Bus bus. + . BusPolicy= - If specfied, a custom kdbus + If specified, a custom + kdbus endpoint will be created and installed as the default bus node for the service. Such a custom endpoint can hold an own set of policy rules @@ -330,7 +329,7 @@ of two parts; the bus name, and a verb to specify to granted access, which is one of , - or + , or . implies , and @@ -351,72 +350,59 @@ ExecStart= Commands with their arguments that are executed when this - service is started. For each of the - specified commands, the first argument - must be an absolute and literal path - to an executable. + service is started. The value is split + into zero or more command lines is + according to the rules described below + (see section "Command Lines" below). + When Type is not , only one command may and must be given. When Type=oneshot is - used, none or more than one command - may be specified. Multiple command - lines may be concatenated in a single - directive by separating them with - semicolons (these semicolons must be - passed as separate - words). Alternatively, this directive - may be specified more than once with - the same effect. Lone semicolons may - be escaped as - \;. 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 + used, zero or more commands may be + specified. This can 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 ExecStart= is specified, then the service must have RemainAfterExit=yes set. - Each command line is split on - whitespace, with the first item being - the command to execute, and the - subsequent items being the arguments. - Double quotes ("...") and single - quotes ('...') may be used, in which - case everything until the next - matching quote becomes part of the - same argument. Quotes themselves are - removed after parsing. In addition, a - trailing backslash - (\) may be used to - merge lines. This syntax is intended - to be very similar to shell syntax, - but only the meta-characters and - expansions described in the following - paragraphs are understood. - Specifically, redirection using - <, - <<, - >, and - >>, pipes - using |, and - running programs in the background - using & - and other elements of shell - syntax are not supported. - + For each of the specified + commands, the first argument must be + an absolute and literal path to an + executable. Optionally, if the + absolute file name is prefixed with + @, the second token + will be passed as + argv[0] to the + executed process, followed by the + further arguments specified. If the + absolute filename is prefixed with + -, an exit code of + the command normally considered a + failure (i.e. non-zero exit status or + abnormal exit due to signal) is + ignored and considered success. If + both - and + @ are used, they + can appear in either order. 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 -), other lines - are not executed, and the unit is - considered failed. + with -), other + lines are not executed, and the unit + is considered failed. Unless Type=forking is @@ -424,106 +410,6 @@ command line will be considered the main process of the daemon. - The command line accepts - % specifiers as - described in - systemd.unit5. - Note that the first argument of the - command line (i.e. the program to - execute) may not include - specifiers. - - Basic environment variable - substitution is supported. Use - ${FOO} as part of a - word, or as a word of its own, on the - command line, in which case it will be - replaced by the value of the - environment variable including all - whitespace it contains, resulting in a - single argument. Use - $FOO as a separate - word on the command line, in which - case it will be replaced by the value - of the environment variable split at - whitespace, resulting in zero or more - arguments. To pass a literal dollar - sign, use $$. - Variables whose value is not known at - expansion time are treated as empty - strings. Note that the first argument - (i.e. the program to execute) may not - be a variable. - - Variables to be used in this - fashion may be defined through - Environment= and - EnvironmentFile=. - In addition, variables listed in the - section "Environment variables in - spawned processes" in - systemd.exec5, - which are considered "static - configuration", may be used (this includes - e.g. $USER, but not - $TERM). - - Optionally, if the absolute file - name is prefixed with - @, the second token - will be passed as - argv[0] to the - executed process, followed by the - further arguments specified. If the - absolute filename is prefixed with - -, an exit code of - the command normally considered a - failure (i.e. non-zero exit status or - abnormal exit due to signal) is ignored - and considered success. If both - - and - @ are used, they - can appear in either order. - - Note that this setting does not - directly support shell command - lines. If shell command lines are to - be used, they need to be passed - explicitly to a shell implementation - of some kind. Example: - ExecStart=/bin/sh -c 'dmesg | tac' - Example: - ExecStart=/bin/echo one ; /bin/echo "two two" - This will execute - /bin/echo two - times, each time with one argument: - one and - two two, - respectively. Because two commands are - specified, - Type=oneshot must - be used. - - Example: - ExecStart=/bin/echo / >/dev/null & \; \ -/bin/ls - This will execute - /bin/echo with five - arguments: /, - >/dev/null, - &, - ;, and - /bin/ls. - - Example: - Environment="ONE=one" 'TWO=two two' -ExecStart=/bin/echo $ONE $TWO ${TWO} - This will execute - /bin/echo with four - arguments: one, - two, - two, and - two two. @@ -660,7 +546,7 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} when Type=oneshot is used, in which case the timeout is disabled by default - (see systemd-systemd.conf5). + (see systemd-system.conf5). @@ -681,7 +567,7 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} the timeout logic. Defaults to DefaultTimeoutStopSec= from the manager configuration file - (see systemd-systemd.conf5). + (see systemd-system.conf5). @@ -705,8 +591,9 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} (i.e. the "keep-alive ping"). If the time between two such calls is larger than the configured time, then the service - is placed in a failed state. By - setting Restart= to + is placed in a failed state and it will + be terminated with SIGABRT. + By setting Restart= to or , the service will be automatically restarted. The @@ -1080,21 +967,24 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} Sockets= Specifies the name of the socket units this service shall - inherit the sockets from when the - service is started. Normally it - should not be necessary to use this - setting as all sockets whose unit + 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 - (ignoring the different suffix of course) - are passed to the spawned - process. - - Note that the same socket may be - passed to multiple processes at the - same time. Also note that a different - service may be activated on incoming - traffic than that which inherits the - sockets. Or in other words: the + (subject to the different unit name + suffix of course) are passed to the + spawned process. + + 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 Service= setting of .socket units does not have to match the inverse of @@ -1239,37 +1129,130 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} - Compatibility Options + Command lines + + This section describes command line parsing and + variable and specifier substitions for + ExecStart=, + ExecStartPre=, + ExecStartPost=, + ExecReload=, + ExecStop=, and + ExecStopPost= options. + + Multiple command lines may be concatenated in a + single directive by separating them with semicolons + (these semicolons must be passed as separate words). + Lone semicolons may be escaped as + \;. + + Each command line is split on whitespace, with + the first item being the command to execute, and the + subsequent items being the arguments. Double quotes + ("...") and single quotes ('...') may be used, in + which case everything until the next matching quote + becomes part of the same argument. Quotes themselves + are removed after parsing. In addition, a trailing + backslash (\) may be used to merge + lines. + + This syntax is intended to be very similar to + shell syntax, but only the meta-characters and + expansions described in the following paragraphs are + understood. Specifically, redirection using + <, <<, + >, and + >>, pipes using + |, running programs in the + background using &, and + other elements of shell syntax are not + supported. + + The command line accepts % + specifiers as described in + systemd.unit5. + Note that the first argument of the command line + (i.e. the program to execute) may not include + specifiers. + + Basic environment variable substitution is + supported. Use ${FOO} as part of a + word, or as a word of its own, on the command line, in + which case it will be replaced by the value of the + environment variable including all whitespace it + contains, resulting in a single argument. Use + $FOO as a separate word on the + command line, in which case it will be replaced by the + value of the environment variable split at whitespace + resulting in zero or more arguments. For this type of + expansion, quotes and respected when splitting into + words, and afterwards removed. + + Example: + + Environment="ONE=one" 'TWO=two two' +ExecStart=/bin/echo $ONE $TWO ${TWO} - The following options are also available in the - [Service] section, but exist purely - for compatibility reasons and should not be used in - newly written service files. + This will execute /bin/echo + with four arguments: one, + two, two, and + two two. + + Example: + Environment=ONE='one' "TWO='two two' too" THREE= +ExecStart=/bin/echo ${ONE} ${TWO} ${THREE} +ExecStart=/bin/echo $ONE $TWO $THREE + This results in echo being + called twice, the first time with arguments + 'one', + 'two two' too, , + and the second time with arguments + one, two two, + too. + - - - SysVStartPriority= - Set the SysV start - priority to use to order this service - in relation to SysV services lacking - LSB headers. This option is only - necessary to fix ordering in relation - to legacy SysV services that have no - ordering information encoded in the - script headers. As such, it should only - be used as a temporary compatibility - option and should not be used in new unit - files. Almost always, it is a better - choice to add explicit ordering - directives via - After= or - Before=, - instead. For more details, see - systemd.unit5. - If used, pass an integer value in the - range 0-99. - - + To pass a literal dollar sign, use + $$. Variables whose value is not + known at expansion time are treated as empty + strings. Note that the first argument (i.e. the + program to execute) may not be a variable. + + Variables to be used in this fashion may be + defined through Environment= and + EnvironmentFile=. In addition, + variables listed in the section "Environment variables + in spawned processes" in + systemd.exec5, + which are considered "static configuration", may be + used (this includes e.g. $USER, but + not $TERM). + + Note that shell command lines are not directly + supported. If shell command lines are to be used, they + need to be passed explicitly to a shell implementation + of some kind. Example: + ExecStart=/bin/sh -c 'dmesg | tac' + + Example: + + ExecStart=/bin/echo one ; /bin/echo "two two" + + This will execute /bin/echo + two times, each time with one argument: + one and two two, + respectively. Because two commands are specified, + Type=oneshot must be used. + + Example: + + ExecStart=/bin/echo / >/dev/null & \; \ +/bin/ls + + This will execute /bin/echo + with five arguments: /, + >/dev/null, + &, ;, and + /bin/ls.