Skip to content

Commit

Permalink
man: explicitly distinguish "implicit dependencies" and "default depe…
Browse files Browse the repository at this point in the history
…ndencies"

Fixes: systemd#6793
  • Loading branch information
johnlinp committed Sep 13, 2017
1 parent bbe0b4a commit 45f09f9
Show file tree
Hide file tree
Showing 15 changed files with 371 additions and 225 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
29 changes: 20 additions & 9 deletions man/systemd.automount.xml
Expand Up @@ -87,19 +87,30 @@
</refsect1>

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

<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>The following dependencies are implicitly added:</para>

<para>An implicit <varname>Before=</varname> dependency is created
between an automount unit and the mount unit it activates.</para>
<itemizedlist>
<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
<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>
<listitem><para>An implicit <varname>Before=</varname> dependency is created
between an automount unit and the mount unit it activates.</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>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>
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
43 changes: 23 additions & 20 deletions man/systemd.exec.xml
Expand Up @@ -81,27 +81,30 @@
</refsect1>

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

<para>A few execution parameters result in additional, automatic
dependencies to be added.</para>

<para>Units with <varname>WorkingDirectory=</varname>, <varname>RootDirectory=</varname>, <varname>RootImage=</varname>,
<varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>,
<varname>LogsDirectory=</varname> or <varname>ConfigurationDirectory=</varname> set automatically gain dependencies
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>

<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
automatic <varname>After=</varname> dependency on
<citerefentry><refentrytitle>systemd-tmpfiles-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>

<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
of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.</para>
<title>Implicit Dependencies</title>

<para>A few execution parameters result in additional, automatic dependencies to be added:</para>

<itemizedlist>
<listitem><para>Units with <varname>WorkingDirectory=</varname>, <varname>RootDirectory=</varname>, <varname>RootImage=</varname>,
<varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>,
<varname>LogsDirectory=</varname> or <varname>ConfigurationDirectory=</varname> set automatically gain dependencies
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>

<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
automatic <varname>After=</varname> dependency on
<citerefentry><refentrytitle>systemd-tmpfiles-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>

<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
of type <varname>After=</varname> on <filename>systemd-journald.socket</filename>.</para></listitem>
</itemizedlist>
</refsect1>

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

<refsect1>
<title>Options</title>

Expand Down Expand Up @@ -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
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
81 changes: 49 additions & 32 deletions man/systemd.mount.xml
Expand Up @@ -109,40 +109,57 @@
</refsect1>

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

<para>If a mount unit is beneath another mount unit in the file
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
<varname>BindsTo=</varname> and <varname>After=</varname> type
dependencies on the device unit encapsulating the block
device (see below).</para>

<para>If traditional file system quota is enabled for a mount
unit, automatic <varname>Wants=</varname> and
<varname>Before=</varname> dependencies on
<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
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
<varname>Wants=</varname> unit is added as well. Mount units referring to local and network file systems are
<title>Implicit Dependencies</title>

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

<itemizedlist>
<listitem><para>If a mount unit is beneath another mount unit in the file
system hierarchy, both a requirement dependency and an ordering
dependency between both units are created automatically.</para></listitem>

<listitem><para>Block device backed file systems automatically gain
<varname>BindsTo=</varname> and <varname>After=</varname> type
dependencies on the device unit encapsulating the block
device (see below).</para></listitem>

<listitem><para>If traditional file system quota is enabled for a mount
unit, automatic <varname>Wants=</varname> and
<varname>Before=</varname> dependencies on
<filename>systemd-quotacheck.service</filename> and
<filename>quotaon.service</filename> are added.</para></listitem>

<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
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
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>
string of the unit, which forces systemd to consider the mount unit a network mount.</para>
</refsect1>

<refsect1>
Expand Down
47 changes: 30 additions & 17 deletions man/systemd.path.xml
Expand Up @@ -82,23 +82,36 @@
</refsect1>

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

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

<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>,
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>
<title>Implicit Dependencies</title>

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

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

<listitem><para>An implicit <varname>Before=</varname> dependency is added
between a path unit and the unit it is supposed to activate.</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>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>
Expand Down
15 changes: 11 additions & 4 deletions man/systemd.resource-control.xml
Expand Up @@ -93,12 +93,19 @@
</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>
<para>The following dependencies are implicitly added:</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>

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

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

Expand Down Expand Up @@ -578,7 +585,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
33 changes: 21 additions & 12 deletions man/systemd.scope.xml
Expand Up @@ -75,22 +75,31 @@
</refsect1>

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

<para>Unless <varname>DefaultDependencies=false</varname>
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>
<title>Implicit Dependencies</title>

<para>Additional implicit dependencies may be added as result 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>

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

0 comments on commit 45f09f9

Please sign in to comment.