Skip to content

Commit

Permalink
man: explicitly distinguish "automatic dependencies" and "default dep…
Browse files Browse the repository at this point in the history
…endencies"

Fixes: systemd#6793
  • Loading branch information
johnlinp committed Sep 12, 2017
1 parent bbe0b4a commit 18640b9
Show file tree
Hide file tree
Showing 15 changed files with 199 additions and 104 deletions.
2 changes: 1 addition & 1 deletion man/systemd-gpt-auto-generator.xml
Expand Up @@ -70,7 +70,7 @@
<citerefentry
project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
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
same physical disk the EFI System Partition (ESP) is located on.
Expand Down
14 changes: 10 additions & 4 deletions man/systemd.automount.xml
Expand Up @@ -87,19 +87,25 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<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>

<para>An implicit <varname>Before=</varname> dependency is created
between an automount unit and the mount unit it activates.</para>
</refsect1>

<para>Automount units acquire automatic <varname>Before=</varname> and <varname>Conflicts=</varname> on
<filename>umount.target</filename> in order to be stopped during shutdown, unless
<varname>DefaultDependencies=no</varname> is set in the <literal>[Unit]</literal> section.</para>
<refsect1>
<title>Default Dependencies</title>

<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set.</para>

<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>
</refsect1>

<refsect1>
Expand Down
8 changes: 7 additions & 1 deletion man/systemd.device.xml
Expand Up @@ -86,7 +86,7 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>Many unit types automatically acquire dependencies on device
units of devices they require. For example,
Expand All @@ -97,6 +97,12 @@
block devices.</para>
</refsect1>

<refsect1>
<title>Default Dependencies</title>

<para>There are no default dependencies for device units.</para>
</refsect1>

<refsect1>
<title>The udev Database</title>

Expand Down
6 changes: 4 additions & 2 deletions man/systemd.exec.xml
Expand Up @@ -81,7 +81,7 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>A few execution parameters result in additional, automatic
dependencies to be added.</para>
Expand All @@ -102,6 +102,8 @@
of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.</para>
</refsect1>

<!-- We don't have any default dependency here. -->

<refsect1>
<title>Options</title>

Expand Down Expand Up @@ -591,7 +593,7 @@

<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
<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
<option>DefaultStandardOutput=</option> in
Expand Down
25 changes: 16 additions & 9 deletions man/systemd.mount.xml
Expand Up @@ -109,7 +109,9 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<para>If a mount unit is beneath another mount unit in the file
system hierarchy, both a requirement dependency and an ordering
Expand All @@ -126,8 +128,19 @@
<filename>systemd-quotacheck.service</filename> and
<filename>quotaon.service</filename> are added.</para>

<para>For mount units with <varname>DefaultDependencies=yes</varname> in the <literal>[Unit]</literal> section (the
default) a couple additional dependencies are added. Mount units referring to local file systems automatically gain
<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>
<title>Default Dependencies</title>

<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set.</para>

<para>Mount units referring to local file systems automatically gain
an <varname>After=</varname> dependency on <filename>local-fs-pre.target</filename>. 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
Expand All @@ -137,12 +150,6 @@
string of the unit, which forces systemd to consider the mount unit a network mount. Mount units (regardless if
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>
Expand Down
21 changes: 15 additions & 6 deletions man/systemd.path.xml
Expand Up @@ -82,23 +82,32 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<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>

<para>An implicit <varname>Before=</varname> dependency is added
between a path unit and the unit it is supposed to activate.</para>
</refsect1>

<refsect1>
<title>Default Dependencies</title>

<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set.</para>

<para>Unless <varname>DefaultDependencies=false</varname> in the <literal>[Unit]</literal> section is used, path
units will implicitly have dependencies of type <varname>Before=</varname> on <filename>paths.target</filename>,
<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
this option.
</para>
cleanly prior to system shutdown.</para>

<para>Only path units involved with early boot or late system shutdown should disable
<varname>DefaultDependencies=</varname> option.</para>
</refsect1>

<refsect1>
Expand Down
6 changes: 4 additions & 2 deletions man/systemd.resource-control.xml
Expand Up @@ -93,12 +93,14 @@
</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
<varname>After=</varname> dependencies on the specified slice unit.</para>
</refsect1>

<!-- We don't have any default dependency here. -->

<refsect1>
<title>Unified and Legacy Control Group Hierarchies</title>

Expand Down Expand Up @@ -578,7 +580,7 @@
<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
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, section
"Automatic Dependencies" for details.</para>
"Default Dependencies" for details.</para>

</listitem>
</varlistentry>
Expand Down
25 changes: 15 additions & 10 deletions man/systemd.scope.xml
Expand Up @@ -75,22 +75,27 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>Unless <varname>DefaultDependencies=false</varname>
is used, scope units will implicitly have dependencies of
<para>Implicit dependencies may be added as result of
resource control parameters as documented in
<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>

<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 this option.
</para>

<para>Additional implicit dependencies may be added as result of
resource control parameters as documented in
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
shutdown.</para>

<para>Only scope units involved with early boot or
late system shutdown should disable <varname>DefaultDependencies=</varname> option.</para>
</refsect1>

<refsect1>
Expand Down
25 changes: 16 additions & 9 deletions man/systemd.service.xml
Expand Up @@ -89,7 +89,9 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<para>Services with <varname>Type=dbus</varname> set automatically
acquire dependencies of type <varname>Requires=</varname> and
Expand All @@ -103,8 +105,19 @@
listed in <varname>Sockets=</varname> via automatic
<varname>Wants=</varname> and <varname>After=</varname> dependencies.</para>

<para>Unless <varname>DefaultDependencies=</varname> in the <literal>[Unit]</literal> is set to
<option>false</option>, service units will implicitly have dependencies of type <varname>Requires=</varname> and
<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>
<title>Default Dependencies</title>

<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set.</para>

<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
Expand All @@ -120,12 +133,6 @@
<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
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>
Expand Down
21 changes: 15 additions & 6 deletions man/systemd.slice.xml
Expand Up @@ -103,17 +103,26 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<para>Slice units automatically gain dependencies of type
<varname>After=</varname> and <varname>Requires=</varname> on
their immediate parent slice unit.</para>
</refsect1>

<para>Unless <varname>DefaultDependencies=false</varname> is used in the <literal>[Unit]</literal> section, slice
units will implicitly 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 early boot or late system shutdown should disable this option.
</para>
<refsect1>
<title>Default Dependencies</title>

<para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set.</para>

<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.</para>

<para>Only slice units involved with late system shutdown should disable
<varname>DefaultDependencies=</varname> option.</para>
</refsect1>

<refsect1>
Expand Down
40 changes: 21 additions & 19 deletions man/systemd.socket.xml
Expand Up @@ -97,16 +97,7 @@
<filename>foo@.service</filename> must exist from which services
are instantiated for each incoming connection.</para>

<para>Unless <varname>DefaultDependencies=</varname> in the <literal>[Unit]</literal> section is set to
<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
<para>No implicit <varname>WantedBy=</varname> or
<varname>RequiredBy=</varname> dependency from the socket to the
service is added. This means that the service may be started
without the socket, in which case it must be able to open sockets
Expand All @@ -130,7 +121,9 @@
</refsect1>

<refsect1>
<title>Automatic Dependencies</title>
<title>Implicit Dependencies</title>

<para>The following dependencies are implicitly added.</para>

<para>Socket units automatically gain a <varname>Before=</varname>
dependency on the service units they activate.</para>
Expand All @@ -145,8 +138,20 @@
<varname>After=</varname> dependency on the device unit
encapsulating the specified network interface.</para>

<para>If <varname>DefaultDependencies=yes</varname> is set (the
default), socket units automatically gain a
<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>
<title>Default Dependencies</title>

<para>The following dependencies are added unless
<varname>DefaultDependencies=no</varname> is set.</para>

<para>Socket units automatically gain a
<varname>Before=</varname> dependency on
<filename>sockets.target</filename>. They also gain a pair of
<varname>After=</varname> and <varname>Requires=</varname>
Expand All @@ -156,11 +161,8 @@
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
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>
<para>Only sockets involved with early boot or late system shutdown
should disable <varname>DefaultDependencies=</varname> option.</para>
</refsect1>

<refsect1>
Expand Down Expand Up @@ -358,7 +360,7 @@
specified network interfaces. This controls the
SO_BINDTODEVICE socket option (see <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
(<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
is created. Note that setting this parameter might result in
Expand Down

0 comments on commit 18640b9

Please sign in to comment.