man: document automatic dependencies

For all units ensure there's an "Automatic Dependencies" section in the
man page, and explain which dependencies are automatically added in all
cases, and which ones are added on top if DefaultDependencies=yes is
set.

This is also done for systemd.exec(5), systemd.resource-control(5) and
systemd.unit(5) as these pages describe common behaviour of various unit
types.
This commit is contained in:
Lennart Poettering
2015-11-11 20:47:07 +01:00
parent ea0ec5cea7
commit c129bd5df3
14 changed files with 312 additions and 67 deletions
+21 -11
View File
@@ -1,4 +1,4 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
@@ -73,19 +73,29 @@
<filename>foo.timer</filename> activates a matching service
<filename>foo.service</filename>. The unit to activate may be
controlled by <varname>Unit=</varname> (see below).</para>
</refsect1>
<refsect1>
<title>Automatic Dependencies</title>
<para>Timer units automatically gain a <varname>Before=</varname>
dependency on the service they are supposed to activate.</para>
<para>Unless <varname>DefaultDependencies=</varname> is set to
<option>false</option>, all timer units will implicitly have
dependencies of type <varname>Conflicts=</varname> and
<varname>Before=</varname> on <filename>shutdown.target</filename>
to ensure that they are stopped cleanly prior to system shutdown.
Timer units with at least one <varname>OnCalendar=</varname>
directive will have an additional <varname>After=</varname>
dependency on <filename>timer-sync.target</filename> to avoid
being started before the system clock has been correctly set. Only
timer units involved with early boot or late system shutdown
should disable the <varname>DefaultDependencies=</varname>
option.</para>
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. Timer units with at
least one <varname>OnCalendar=</varname> directive will have an
additional <varname>After=</varname> dependency on
<filename>timer-sync.target</filename> to avoid being started
before the system clock has been correctly set. Only timer units
involved with early boot or late system shutdown should disable
the <varname>DefaultDependencies=</varname> option.</para>
</refsect1>
<refsect1>