man: explicitly distinguish "implicit dependencies" and "default dependencies"

Fixes: #6793
This commit is contained in:
John Lin 2017-09-12 12:02:27 +08:00
parent bbe0b4a8d5
commit 45f09f939b
15 changed files with 347 additions and 201 deletions

View File

@ -70,7 +70,7 @@
<citerefentry <citerefentry
project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>), project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
the units this generator creates are overridden, but additional the units this generator creates are overridden, but additional
automatic dependencies might be created.</para> implicit dependencies might be created.</para>
<para>This generator will only look for root partitions on the <para>This generator will only look for root partitions on the
same physical disk the EFI System Partition (ESP) is located on. same physical disk the EFI System Partition (ESP) is located on.

View File

@ -87,19 +87,30 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>If an automount unit is beneath another mount unit in the <para>The following dependencies are implicitly added:</para>
file system hierarchy, both a requirement and an ordering
dependency between both units are created automatically.</para>
<para>An implicit <varname>Before=</varname> dependency is created <itemizedlist>
between an automount unit and the mount unit it activates.</para> <listitem><para>If an automount unit is beneath another mount unit in the
file system hierarchy, both a requirement and an ordering
dependency between both units are created automatically.</para></listitem>
<para>Automount units acquire automatic <varname>Before=</varname> and <varname>Conflicts=</varname> on <listitem><para>An implicit <varname>Before=</varname> dependency is created
<filename>umount.target</filename> in order to be stopped during shutdown, unless between an automount unit and the mount unit it activates.</para></listitem>
<varname>DefaultDependencies=no</varname> is set in the <literal>[Unit]</literal> section.</para> </itemizedlist>
</refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Automount units acquire automatic <varname>Before=</varname> and
<varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
shutdown.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -86,7 +86,7 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Many unit types automatically acquire dependencies on device <para>Many unit types automatically acquire dependencies on device
units of devices they require. For example, units of devices they require. For example,
@ -97,6 +97,12 @@
block devices.</para> block devices.</para>
</refsect1> </refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>There are no default dependencies for device units.</para>
</refsect1>
<refsect1> <refsect1>
<title>The udev Database</title> <title>The udev Database</title>

View File

@ -81,27 +81,30 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>A few execution parameters result in additional, automatic <para>A few execution parameters result in additional, automatic dependencies to be added:</para>
dependencies to be added.</para>
<para>Units with <varname>WorkingDirectory=</varname>, <varname>RootDirectory=</varname>, <varname>RootImage=</varname>, <itemizedlist>
<varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>, <listitem><para>Units with <varname>WorkingDirectory=</varname>, <varname>RootDirectory=</varname>, <varname>RootImage=</varname>,
<varname>LogsDirectory=</varname> or <varname>ConfigurationDirectory=</varname> set automatically gain dependencies <varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>,
of type <varname>Requires=</varname> and <varname>After=</varname> on all mount units required to access the specified paths. <varname>LogsDirectory=</varname> or <varname>ConfigurationDirectory=</varname> set automatically gain dependencies
This is equivalent to having them listed explicitly in <varname>RequiresMountsFor=</varname>.</para> of type <varname>Requires=</varname> and <varname>After=</varname> on all mount units required to access the specified paths.
This is equivalent to having them listed explicitly in <varname>RequiresMountsFor=</varname>.</para></listitem>
<para>Similar, units with <varname>PrivateTmp=</varname> enabled automatically get mount unit dependencies for all <listitem><para>Similar, units with <varname>PrivateTmp=</varname> enabled automatically get mount unit dependencies for all
mounts required to access <filename>/tmp</filename> and <filename>/var/tmp</filename>. They will also gain an mounts required to access <filename>/tmp</filename> and <filename>/var/tmp</filename>. They will also gain an
automatic <varname>After=</varname> dependency on automatic <varname>After=</varname> dependency on
<citerefentry><refentrytitle>systemd-tmpfiles-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd-tmpfiles-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
<para>Units whose standard output or error output is connected to <option>journal</option>, <option>syslog</option> <listitem><para>Units whose standard output or error output is connected to <option>journal</option>, <option>syslog</option>
or <option>kmsg</option> (or their combinations with console output, see below) automatically acquire dependencies or <option>kmsg</option> (or their combinations with console output, see below) automatically acquire dependencies
of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.</para> of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<!-- We don't have any default dependency here. -->
<refsect1> <refsect1>
<title>Options</title> <title>Options</title>
@ -591,7 +594,7 @@
<para>If the standard output (or error output, see below) of a unit is connected to the journal, syslog or the <para>If the standard output (or error output, see below) of a unit is connected to the journal, syslog or the
kernel log buffer, the unit will implicitly gain a dependency of type <varname>After=</varname> on kernel log buffer, the unit will implicitly gain a dependency of type <varname>After=</varname> on
<filename>systemd-journald.socket</filename> (also see the automatic dependencies section above).</para> <filename>systemd-journald.socket</filename> (also see the "Implicit Dependencies" section above).</para>
<para>This setting defaults to the value set with <para>This setting defaults to the value set with
<option>DefaultStandardOutput=</option> in <option>DefaultStandardOutput=</option> in

View File

@ -109,40 +109,57 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>If a mount unit is beneath another mount unit in the file <para>The following dependencies are implicitly added:</para>
system hierarchy, both a requirement dependency and an ordering
dependency between both units are created automatically.</para>
<para>Block device backed file systems automatically gain <itemizedlist>
<varname>BindsTo=</varname> and <varname>After=</varname> type <listitem><para>If a mount unit is beneath another mount unit in the file
dependencies on the device unit encapsulating the block system hierarchy, both a requirement dependency and an ordering
device (see below).</para> dependency between both units are created automatically.</para></listitem>
<para>If traditional file system quota is enabled for a mount <listitem><para>Block device backed file systems automatically gain
unit, automatic <varname>Wants=</varname> and <varname>BindsTo=</varname> and <varname>After=</varname> type
<varname>Before=</varname> dependencies on dependencies on the device unit encapsulating the block
<filename>systemd-quotacheck.service</filename> and device (see below).</para></listitem>
<filename>quotaon.service</filename> are added.</para>
<para>For mount units with <varname>DefaultDependencies=yes</varname> in the <literal>[Unit]</literal> section (the <listitem><para>If traditional file system quota is enabled for a mount
default) a couple additional dependencies are added. Mount units referring to local file systems automatically gain unit, automatic <varname>Wants=</varname> and
an <varname>After=</varname> dependency on <filename>local-fs-pre.target</filename>. Network mount units <varname>Before=</varname> dependencies on
automatically acquire <varname>After=</varname> dependencies on <filename>remote-fs-pre.target</filename>, <filename>systemd-quotacheck.service</filename> and
<filename>network.target</filename> and <filename>network-online.target</filename>. Towards the latter a <filename>quotaon.service</filename> are added.</para></listitem>
<varname>Wants=</varname> unit is added as well. Mount units referring to local and network file systems are
<listitem><para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</itemizedlist>
</refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>All mount units acquire automatic <varname>Before=</varname> and <varname>Conflicts=</varname> on
<filename>umount.target</filename> in order to be stopped during shutdown.</para></listitem>
<listitem><para>Mount units referring to local file systems automatically gain
an <varname>After=</varname> dependency on <filename>local-fs-pre.target</filename>.</para></listitem>
<listitem><para>Network mount units
automatically acquire <varname>After=</varname> dependencies on <filename>remote-fs-pre.target</filename>,
<filename>network.target</filename> and <filename>network-online.target</filename>. Towards the latter a
<varname>Wants=</varname> unit is added as well.</para></listitem>
</itemizedlist>
<para>Mount units referring to local and network file systems are
distinguished by their file system type specification. In some cases this is not sufficient (for example network distinguished by their file system type specification. In some cases this is not sufficient (for example network
block device based mounts, such as iSCSI), in which case <option>_netdev</option> may be added to the mount option block device based mounts, such as iSCSI), in which case <option>_netdev</option> may be added to the mount option
string of the unit, which forces systemd to consider the mount unit a network mount. Mount units (regardless if string of the unit, which forces systemd to consider the mount unit a network mount.</para>
local or network) also acquire automatic <varname>Before=</varname> and <varname>Conflicts=</varname> on
<filename>umount.target</filename> in order to be stopped during shutdown.</para>
<para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
and
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -82,23 +82,36 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>If a path unit is beneath another mount unit in the file <para>The following dependencies are implicitly added:</para>
system hierarchy, both a requirement and an ordering dependency
between both units are created automatically.</para>
<para>An implicit <varname>Before=</varname> dependency is added <itemizedlist>
between a path unit and the unit it is supposed to activate.</para> <listitem><para>If a path unit is beneath another mount unit in the file
system hierarchy, both a requirement and an ordering dependency
between both units are created automatically.</para></listitem>
<para>Unless <varname>DefaultDependencies=false</varname> in the <literal>[Unit]</literal> section is used, path <listitem><para>An implicit <varname>Before=</varname> dependency is added
units will implicitly have dependencies of type <varname>Before=</varname> on <filename>paths.target</filename>, between a path unit and the unit it is supposed to activate.</para></listitem>
dependencies of type <varname>After=</varname> and <varname>Requires=</varname> on </itemizedlist>
<filename>sysinit.target</filename>, and have dependencies of type <varname>Conflicts=</varname> and </refsect1>
<varname>Before=</varname> on <filename>shutdown.target</filename>. These ensure that path units are terminated
cleanly prior to system shutdown. Only path units involved with early boot or late system shutdown should disable <refsect1>
this option. <title>Default Dependencies</title>
</para>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Path units will automatically have dependencies of type <varname>Before=</varname> on
<filename>paths.target</filename>,
dependencies of type <varname>After=</varname> and <varname>Requires=</varname> on
<filename>sysinit.target</filename>, and have dependencies of type <varname>Conflicts=</varname> and
<varname>Before=</varname> on <filename>shutdown.target</filename>. These ensure that path units are terminated
cleanly prior to system shutdown. Only path units involved with early boot or late system shutdown should
disable <varname>DefaultDependencies=</varname> option.</para></listitem>
</itemizedlist>
<para></para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -93,12 +93,19 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Units with the <varname>Slice=</varname> setting set automatically acquire <varname>Requires=</varname> and <para>The following dependencies are implicitly added:</para>
<varname>After=</varname> dependencies on the specified slice unit.</para>
<itemizedlist>
<listitem><para>Units with the <varname>Slice=</varname> setting set automatically acquire
<varname>Requires=</varname> and <varname>After=</varname> dependencies on the specified
slice unit.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<!-- We don't have any default dependency here. -->
<refsect1> <refsect1>
<title>Unified and Legacy Control Group Hierarchies</title> <title>Unified and Legacy Control Group Hierarchies</title>
@ -578,7 +585,7 @@
<para>Special care should be taken when relying on the default slice assignment in templated service units <para>Special care should be taken when relying on the default slice assignment in templated service units
that have <varname>DefaultDependencies=no</varname> set, see that have <varname>DefaultDependencies=no</varname> set, see
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, section <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, section
"Automatic Dependencies" for details.</para> "Default Dependencies" for details.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -75,22 +75,31 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Unless <varname>DefaultDependencies=false</varname> <para>Implicit dependencies may be added as result of
is used, scope units will implicitly have dependencies of
type <varname>Conflicts=</varname> and
<varname>Before=</varname> on
<filename>shutdown.target</filename>. These ensure
that scope units are removed prior to system
shutdown. Only scope units involved with early boot or
late system shutdown should disable this option.
</para>
<para>Additional implicit dependencies may be added as result of
resource control parameters as documented in resource control parameters as documented in
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless
<varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Scope units will automatically have dependencies of
type <varname>Conflicts=</varname> and
<varname>Before=</varname> on
<filename>shutdown.target</filename>. These ensure
that scope units are removed prior to system
shutdown. Only scope units involved with early boot or
late system shutdown should disable
<varname>DefaultDependencies=</varname> option.</para></listitem>
</itemizedlist>
<para></para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -89,37 +89,23 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Services with <varname>Type=dbus</varname> set automatically <para>The following dependencies are implicitly added:</para>
acquire dependencies of type <varname>Requires=</varname> and
<varname>After=</varname> on
<filename>dbus.socket</filename>.</para>
<para>Socket activated services are automatically ordered after <itemizedlist>
their activating <filename>.socket</filename> units via an <listitem><para>Services with <varname>Type=dbus</varname> set automatically
automatic <varname>After=</varname> dependency. acquire dependencies of type <varname>Requires=</varname> and
Services also pull in all <filename>.socket</filename> units <varname>After=</varname> on
listed in <varname>Sockets=</varname> via automatic <filename>dbus.socket</filename>.</para></listitem>
<varname>Wants=</varname> and <varname>After=</varname> dependencies.</para>
<para>Unless <varname>DefaultDependencies=</varname> in the <literal>[Unit]</literal> is set to <listitem><para>Socket activated services are automatically ordered after
<option>false</option>, service units will implicitly have dependencies of type <varname>Requires=</varname> and their activating <filename>.socket</filename> units via an
<varname>After=</varname> on <filename>sysinit.target</filename>, a dependency of type <varname>After=</varname> on automatic <varname>After=</varname> dependency.
<filename>basic.target</filename> as well as dependencies of type <varname>Conflicts=</varname> and Services also pull in all <filename>.socket</filename> units
<varname>Before=</varname> on <filename>shutdown.target</filename>. These ensure that normal service units pull in listed in <varname>Sockets=</varname> via automatic
basic system initialization, and are terminated cleanly prior to system shutdown. Only services involved with early <varname>Wants=</varname> and <varname>After=</varname> dependencies.</para></listitem>
boot or late system shutdown should disable this option.</para> </itemizedlist>
<para>Instanced service units (i.e. service units with an <literal>@</literal> in their name) are assigned by
default a per-template slice unit (see
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>), named after the
template unit, containing all instances of the specific template. This slice is normally stopped at shutdown,
together with all template instances. If that is not desired, set <varname>DefaultDependencies=no</varname> in the
template unit, and either define your own per-template slice unit file that also sets
<varname>DefaultDependencies=no</varname>, or set <varname>Slice=system.slice</varname> (or another suitable slice)
in the template unit. Also see
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
<para>Additional implicit dependencies may be added as result of <para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in execution and resource control parameters as documented in
@ -128,6 +114,32 @@
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</refsect1> </refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Service units will have dependencies of type <varname>Requires=</varname> and
<varname>After=</varname> on <filename>sysinit.target</filename>, a dependency of type <varname>After=</varname> on
<filename>basic.target</filename> as well as dependencies of type <varname>Conflicts=</varname> and
<varname>Before=</varname> on <filename>shutdown.target</filename>. These ensure that normal service units pull in
basic system initialization, and are terminated cleanly prior to system shutdown. Only services involved with early
boot or late system shutdown should disable this option.</para></listitem>
<listitem><para>Instanced service units (i.e. service units with an <literal>@</literal> in their name) are assigned by
default a per-template slice unit (see
<citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>), named after the
template unit, containing all instances of the specific template. This slice is normally stopped at shutdown,
together with all template instances. If that is not desired, set <varname>DefaultDependencies=no</varname> in the
template unit, and either define your own per-template slice unit file that also sets
<varname>DefaultDependencies=no</varname>, or set <varname>Slice=system.slice</varname> (or another suitable slice)
in the template unit. Also see
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</itemizedlist>
</refsect1>
<refsect1> <refsect1>
<title>Options</title> <title>Options</title>

View File

@ -103,17 +103,29 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Slice units automatically gain dependencies of type <para>The following dependencies are implicitly added:</para>
<varname>After=</varname> and <varname>Requires=</varname> on
their immediate parent slice unit.</para>
<para>Unless <varname>DefaultDependencies=false</varname> is used in the <literal>[Unit]</literal> section, slice <itemizedlist>
units will implicitly have dependencies of type <varname>Conflicts=</varname> and <varname>Before=</varname> on <listitem><para>Slice units automatically gain dependencies of type
<filename>shutdown.target</filename>. These ensure that slice units are removed prior to system shutdown. Only <varname>After=</varname> and <varname>Requires=</varname> on
slice units involved with early boot or late system shutdown should disable this option. their immediate parent slice unit.</para></listitem>
</para> </itemizedlist>
</refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Slice units will automatically have dependencies of type <varname>Conflicts=</varname> and
<varname>Before=</varname> on
<filename>shutdown.target</filename>. These ensure that slice units are removed prior to system shutdown.
Only slice units involved with late system shutdown should disable
<varname>DefaultDependencies=</varname> option.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -97,16 +97,7 @@
<filename>foo@.service</filename> must exist from which services <filename>foo@.service</filename> must exist from which services
are instantiated for each incoming connection.</para> are instantiated for each incoming connection.</para>
<para>Unless <varname>DefaultDependencies=</varname> in the <literal>[Unit]</literal> section is set to <para>No implicit <varname>WantedBy=</varname> or
<option>false</option>, socket units will implicitly have dependencies of type <varname>Requires=</varname> and
<varname>After=</varname> on <filename>sysinit.target</filename> as well as dependencies of type
<varname>Conflicts=</varname> and <varname>Before=</varname> on <filename>shutdown.target</filename>. These ensure
that socket units pull in basic system initialization, and are terminated cleanly prior to system shutdown. Only
sockets involved with early boot or late system shutdown should disable this option.</para>
<para>Socket units will have a <varname>Before=</varname>
dependency on the service which they trigger added implicitly. No
implicit <varname>WantedBy=</varname> or
<varname>RequiredBy=</varname> dependency from the socket to the <varname>RequiredBy=</varname> dependency from the socket to the
service is added. This means that the service may be started service is added. This means that the service may be started
without the socket, in which case it must be able to open sockets without the socket, in which case it must be able to open sockets
@ -130,31 +121,24 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Socket units automatically gain a <varname>Before=</varname> <para>The following dependencies are implicitly added:</para>
dependency on the service units they activate.</para>
<para>Socket units referring to file system paths (such as AF_UNIX <itemizedlist>
sockets or FIFOs) implicitly gain <varname>Requires=</varname> and <listitem><para>Socket units automatically gain a <varname>Before=</varname>
<varname>After=</varname> dependencies on all mount units dependency on the service units they activate.</para></listitem>
necessary to access those paths.</para>
<para>Socket units using the <varname>BindToDevice=</varname> <listitem><para>Socket units referring to file system paths (such as AF_UNIX
setting automatically gain a <varname>BindsTo=</varname> and sockets or FIFOs) implicitly gain <varname>Requires=</varname> and
<varname>After=</varname> dependency on the device unit <varname>After=</varname> dependencies on all mount units
encapsulating the specified network interface.</para> necessary to access those paths.</para></listitem>
<para>If <varname>DefaultDependencies=yes</varname> is set (the <listitem><para>Socket units using the <varname>BindToDevice=</varname>
default), socket units automatically gain a setting automatically gain a <varname>BindsTo=</varname> and
<varname>Before=</varname> dependency on <varname>After=</varname> dependency on the device unit
<filename>sockets.target</filename>. They also gain a pair of encapsulating the specified network interface.</para></listitem>
<varname>After=</varname> and <varname>Requires=</varname> </itemizedlist>
dependency on <filename>sysinit.target</filename>, and a pair of
<varname>Before=</varname> and <varname>Conflicts=</varname>
dependencies on <filename>shutdown.target</filename>. These
dependencies ensure that the socket unit is started before normal
services at boot, and is stopped on shutdown.</para>
<para>Additional implicit dependencies may be added as result of <para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in execution and resource control parameters as documented in
@ -163,6 +147,29 @@
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</refsect1> </refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless
<varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Socket units automatically gain a
<varname>Before=</varname> dependency on
<filename>sockets.target</filename>.</para></listitem>
<listitem><para>Socket units automatically gain a pair of
<varname>After=</varname> and <varname>Requires=</varname>
dependency on <filename>sysinit.target</filename>, and a pair of
<varname>Before=</varname> and <varname>Conflicts=</varname>
dependencies on <filename>shutdown.target</filename>. These
dependencies ensure that the socket unit is started before normal
services at boot, and is stopped on shutdown. Only sockets
involved with early boot or late system shutdown should disable
<varname>DefaultDependencies=</varname> option.</para></listitem>
</itemizedlist>
</refsect1>
<refsect1> <refsect1>
<title>Options</title> <title>Options</title>
@ -358,7 +365,7 @@
specified network interfaces. This controls the specified network interfaces. This controls the
SO_BINDTODEVICE socket option (see <citerefentry SO_BINDTODEVICE socket option (see <citerefentry
project='man-pages'><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry> project='man-pages'><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for details). If this option is used, an automatic dependency for details). If this option is used, an implicit dependency
from this socket unit on the network interface device unit from this socket unit on the network interface device unit
(<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> (<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
is created. Note that setting this parameter might result in is created. Note that setting this parameter might result in

View File

@ -87,17 +87,16 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>All swap units automatically get the <para>The following dependencies are implicitly added:</para>
<varname>BindsTo=</varname> and <varname>After=</varname>
dependencies on the device units or the mount units of the files
they are activated from.</para>
<para>Swap units with <varname>DefaultDependencies=</varname> set to its default <option>yes</option> value in the <itemizedlist>
<literal>[Unit]</literal> section enabled implicitly acquire a <varname>Conflicts=</varname> and a <listitem><para>All swap units automatically get the
<varname>Before=</varname> dependency on <filename>umount.target</filename> so that they are deactivated at <varname>BindsTo=</varname> and <varname>After=</varname>
shutdown as well as a <varname>Before=swap.target</varname> dependency.</para> dependencies on the device units or the mount units of the files
they are activated from.</para></listitem>
</itemizedlist>
<para>Additional implicit dependencies may be added as result of <para>Additional implicit dependencies may be added as result of
execution and resource control parameters as documented in execution and resource control parameters as documented in
@ -106,6 +105,18 @@
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</refsect1> </refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Swap units automatically acquire a <varname>Conflicts=</varname> and a
<varname>Before=</varname> dependency on <filename>umount.target</filename> so that they are deactivated at
shutdown as well as a <varname>Before=swap.target</varname> dependency.</para></listitem>
</itemizedlist>
</refsect1>
<refsect1> <refsect1>
<title><filename>fstab</filename></title> <title><filename>fstab</filename></title>

View File

@ -80,22 +80,29 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Unless <varname>DefaultDependencies=</varname> is set to <para>There are no implicit dependencies for target units.</para>
<option>no</option> in either of related units or an explicit ordering </refsect1>
dependency is already defined, target units will implicitly complement all
configured dependencies of type <varname>Wants=</varname> or
<varname>Requires=</varname> with dependencies of type
<varname>After=</varname>. Note that <varname>Wants=</varname> or
<varname>Requires=</varname> must be defined in the target unit itself — if
you for example define <varname>Wants=</varname>some.target in
some.service, the implicit ordering will not be added.</para>
<para>All target units automatically gain <varname>Conflicts=</varname> <refsect1>
dependency against shutdown.target unless <varname>DefaultDependencies=</varname> <title>Default Dependencies</title>
is set to <option>no</option>.</para>
<para>The following dependencies are added unless
<varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Target units will automatically complement all
configured dependencies of type <varname>Wants=</varname> or
<varname>Requires=</varname> with dependencies of type
<varname>After=</varname>. Note that <varname>Wants=</varname> or
<varname>Requires=</varname> must be defined in the target unit itself — if
you for example define <varname>Wants=</varname>some.target in
some.service, the automatic ordering will not be added.</para></listitem>
<listitem><para>Target units automatically gain <varname>Conflicts=</varname>
dependency against <filename>shutdown.target</filename>.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -82,20 +82,34 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>Timer units automatically gain a <varname>Before=</varname> <para>The following dependencies are implicitly added:</para>
dependency on the service they are supposed to activate.</para>
<para>Unless <varname>DefaultDependencies=</varname> in the <literal>[Unit]</literal> section is set to <itemizedlist>
<option>false</option>, all timer units will implicitly have dependencies of type <varname>Requires=</varname> and <listitem><para>Timer units automatically gain a <varname>Before=</varname>
<varname>After=</varname> on <filename>sysinit.target</filename>, a dependency of type <varname>Before=</varname> dependency on the service they are supposed to activate.</para></listitem>
on <filename>timers.target</filename>, as well as <varname>Conflicts=</varname> and <varname>Before=</varname> on </itemizedlist>
<filename>shutdown.target</filename> to ensure that they are stopped cleanly prior to system shutdown. Timer units </refsect1>
with at least one <varname>OnCalendar=</varname> directive will have an additional <varname>After=</varname>
dependency on <filename>time-sync.target</filename> to avoid being started before the system clock has been <refsect1>
correctly set. Only timer units involved with early boot or late system shutdown should disable the <title>Default Dependencies</title>
<varname>DefaultDependencies=</varname> option.</para>
<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
<itemizedlist>
<listitem><para>Timer units will automatically have dependencies of type <varname>Requires=</varname> and
<varname>After=</varname> on <filename>sysinit.target</filename>, a dependency of type <varname>Before=</varname>
on <filename>timers.target</filename>, as well as <varname>Conflicts=</varname> and <varname>Before=</varname> on
<filename>shutdown.target</filename> to ensure that they are stopped cleanly prior to system shutdown. Only timer
units involved with early boot or late system shutdown should disable the
<varname>DefaultDependencies=</varname> option.</para></listitem>
<listitem><para>Timer units
with at least one <varname>OnCalendar=</varname> directive will have an additional <varname>After=</varname>
dependency on <filename>time-sync.target</filename> to avoid being started before the system clock has been
correctly set.</para></listitem>
</itemizedlist>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -268,24 +268,41 @@
</refsect1> </refsect1>
<refsect1> <refsect1>
<title>Automatic Dependencies</title> <title>Implicit Dependencies</title>
<para>A number of unit dependencies are automatically established, <para>A number of unit dependencies are implicitly established,
depending on unit configuration. On top of that, for units with depending on unit type and unit configuration. These implicit
<varname>DefaultDependencies=yes</varname> (the default) a couple dependencies can make unit configuration file cleaner. For the
of additional dependencies are added. The precise effect of implicit dependencies in each unit type, please refer to
<varname>DefaultDependencies=yes</varname> depends on the unit section "Implicit Dependencies" in respective man pages.</para>
type (see below).</para>
<para>If <varname>DefaultDependencies=yes</varname> is set, units <para>For example, service units with <varname>Type=dbus</varname>
that are referenced by other units of type automatically acquire dependencies of type <varname>Requires=</varname>
<filename>.target</filename> via a <varname>Wants=</varname> or and <varname>After=</varname> on <filename>dbus.socket</filename>. See
<varname>Requires=</varname> dependency might automatically gain <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
an <varname>Before=</varname> dependency too. See
<citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details.</para> for details.</para>
</refsect1> </refsect1>
<refsect1>
<title>Default Dependencies</title>
<para>Default dependencies are similar to implicit dependencies,
but can be turned on and off by setting
<varname>DefaultDependencies=</varname> to <varname>yes</varname>
(the default) and <varname>no</varname>, while implicit dependencies
are always in effect. See section "Default Dependencies" in respective
man pages for the effect of enabling
<varname>DefaultDependencies=</varname> in each unit types.</para>
<para>For example, target units will complement all configured
dependencies of type type <varname>Wants=</varname> or
<varname>Requires=</varname> with dependencies of type
<varname>After=</varname>. See
<citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details. Note that this behavior can be turned off by setting
<varname>DefaultDependencies=no</varname>.</para>
</refsect1>
<refsect1> <refsect1>
<title>Unit File Load Path</title> <title>Unit File Load Path</title>