]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd.target.xml
man: systemd: fix typo (#7746)
[thirdparty/systemd.git] / man / systemd.target.xml
index 2e35e54fc411937ef2c36038639d0869bbaa9c36..4daa9f52fdd788edaacbcf886a2d08c2031e4332 100644 (file)
@@ -3,6 +3,8 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 
 <!--
+  SPDX-License-Identifier: LGPL-2.1+
+
   This file is part of systemd.
 
   Copyright 2010 Lennart Poettering
   </refsect1>
 
   <refsect1>
-    <title>Automatic Dependencies</title>
-
-    <para>Unless <varname>DefaultDependencies=</varname> is set to
-    <option>no</option> in either of releated units or an explicit ordering
-    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>
-    dependency against shutdown.target unless <varname>DefaultDependencies=</varname>
-    is set to <option>no</option>.</para>
+    <title>Implicit Dependencies</title>
+
+    <para>There are no implicit dependencies for target units.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Default Dependencies</title>
+
+    <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> unless <varname>DefaultDependencies=no</varname>
+      is set in the specified units. 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>
+    <title>Example</title>
+
+    <example>
+      <title>Simple standalone target</title>
+
+      <programlisting># emergency-net.target
+
+[Unit]
+Description=Emergency Mode with Networking
+Requires=emergency.target systemd-networkd.service
+After=emergency.target systemd-networkd.service
+AllowIsolate=yes</programlisting>
+
+      <para>When adding dependencies to other units, it's important to check if they set
+      <varname>DefaultDependencies=</varname>. Service units, unless they set
+      <varname>DefaultDependencies=no</varname>, automatically get a dependency on
+      <filename>sysinit.target</filename>. In this case, both
+      <filename>emergency.target</filename> and <filename>systemd-networkd.service</filename>
+      have <varname>DefaultDependencies=no</varname>, so they are suitable for use
+      in this target, and do not pull in <filename>sysinit.target</filename>.</para>
+
+      <para>You can now switch into this emergency mode by running <varname>systemctl
+      isolate emergency-net.target</varname> or by passing the option
+      <varname>systemd.unit=emergency-net.target</varname> on the kernel command
+      line.</para>
+
+      <para>Other units can have <varname>WantedBy=emergency-net.target</varname> in the
+      <varname>[Install]</varname> section. After they are enabled using
+      <command>systemctl enable</command>, they will be started before
+      <varname>emergency-net.target</varname> is started. It is also possible to add
+      arbitrary units as dependencies of <filename>emergency.target</filename> without
+      modifying them by using <command>systemctl add-wants</command>.
+      </para>
+    </example>
   </refsect1>
 
   <refsect1>