SYSTEMD.TARGET(5)
๐ systemd.target โ the manual page, bestie edition ๐
okay so you're here for systemd.target(5), the systemd.target manual, and honestly? you picked a good one. no cap.
โจ NAME โจ
systemd.target โ target unit configuration ๐ฏ
โจ SYNOPSIS โจ
target.target
like. that's it. that's the synopsis. iconic.
๐ธ DESCRIPTION ๐ธ
so a unit configuration file whose name ends in .target is carrying around info about a target unit of systemd. and what do target units do? they group units together and they set up synchronization points for ordering dependencies with other unit files. it's giving project manager energy tbh. ๐
this unit type has no specific options. none. zero. zip. if you want the common options that every unit configuration file has, go read systemd.unit(5). the common config items live in the generic [Unit] and [Install] sections. and there is no separate [Target] section because there are literally no target-specific options that could go in it. the section simply does not exist. periodt. ๐
target units don't offer any extra functionality on top of the generic functionality that units already provide. they merely group units, which lets you use one single target name in Wants= and Requires= settings to establish a dependency on a whole set of units defined by that target โ and in Before= and After= settings to establish ordering. ๐ฆ
targets establish standardized names for synchronization points during boot and shutdown. and this part is important, so listen up: see systemd.special(7) for examples and descriptions of the standard systemd targets. iykyk. ๐ฅ
also target units are a more flexible replacement for SysV runlevels in the classic SysV init system. glow-up fr fr. โจ
โ ๏ธ not me warning you but โ a target unit file must not be empty, or it gets considered a masked unit. so don't do that. it's recommended that you provide a[Unit]section that includes informativeDescription=andDocumentation=options. give your target a personality, bestie. ๐
๐ AUTOMATIC DEPENDENCIES ๐
๐ซ Implicit Dependencies ๐ซ
there are no implicit dependencies for target units. none. free spirit. ๐ง
๐ซ Default Dependencies ๐ซ
these dependencies get added unless DefaultDependencies=no is set:
- target units will automatically complement all configured dependencies of type
Wants=orRequires=with dependencies of typeAfter=, unlessDefaultDependencies=nois set in the specified units.
๐จ and here's the tea: the reverse is not true. for example, definingWants=that.targetinsome.servicewill not automatically add theAfter=that.targetordering dependency forsome.service. instead,some.serviceshould use the primary synchronization function of target type units by setting a specificAfter=that.targetorBefore=that.targetordering dependency in its.serviceunit file. so like. do that. ๐ญ
- target units automatically gain
Conflicts=andBefore=dependencies againstshutdown.target. (yes it's beefing with shutdown.target, respectfully ๐)
๐ OPTIONS ๐
target unit files may include [Unit] and [Install] sections, which are described in systemd.unit(5). no options specific to this file type are supported. that's the whole section. obsessed with the brevity honestly. ๐
โญ EXAMPLE โญ
๐ธ Example 1. 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
okay so when you're adding dependencies to other units, it is 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 they do not pull in sysinit.target. slay. ๐ฅ
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. main character mode activated. ๐
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. the way that works is genuinely so useful bestie ๐ซถ
๐ฆ SEE ALSO ๐ฆ
that's the whole page, bestie, you ate it. ๐ this was systemd 262.1 era of SYSTEMD.TARGET(5) โ go forth and group your units, you gorgeous synchronization point. โจ๐๐ฆ๐
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms