diff --git a/man/systemd.target.xml b/man/systemd.target.xml index b3cccd4e52..dbe7ff014b 100644 --- a/man/systemd.target.xml +++ b/man/systemd.target.xml @@ -98,6 +98,43 @@ + + Example + + + Simple standalone target + + # emergency-net.target + +[Unit] +Description=Emergency Mode with Networking +Requires=emergency.target systemd-networkd.service +After=emergency.target systemd-networkd.service +AllowIsolate=yes + + When adding dependencies to other units, it's important to check if they set + DefaultDependencies=. Service units, unless they set + DefaultDependencies=no, automatically get a dependency on + sysinit.target. In this case, both + emergency.target and systemd-networkd.service + have DefaultDependencies=no, so they are suitable for use + in this target, and do not pull in sysinit.target. + + You can now switch into this emergency mode by running systemctl + isolate emergency-net.target or by passing the option + systemd.unit=emergency-net.target on the kernel command + line. + + Other units can have WantedBy=emergency-net.target in the + [Install] section. After they are enabled using + systemctl enable, they will be started before + emergency-net.target is started. It is also possible to add + arbitrary units as dependencies of emergency.target without + modifying them by using systemctl add-wants. + + + + See Also