1SYSTEMD.TARGET(5) systemd.target SYSTEMD.TARGET(5)
2
3
4
6 systemd.target - Target unit configuration
7
9 target.target
10
12 A unit configuration file whose name ends in ".target" encodes
13 information about a target unit of systemd, which is used for grouping
14 units and as well-known synchronization points during start-up.
15
16 This unit type has no specific options. See systemd.unit(5) for the
17 common options of all unit configuration files. The common
18 configuration items are configured in the generic "[Unit]" and
19 "[Install]" sections. A separate "[Target]" section does not exist,
20 since no target-specific options may be configured.
21
22 Target units do not offer any additional functionality on top of the
23 generic functionality provided by units. They exist merely to group
24 units via dependencies (useful as boot targets), and to establish
25 standardized names for synchronization points used in dependencies
26 between units. Among other things, target units are a more flexible
27 replacement for SysV runlevels in the classic SysV init system. (And
28 for compatibility reasons special target units such as runlevel3.target
29 exist which are used by the SysV runlevel compatibility code in
30 systemd. See systemd.special(7) for details).
31
33 Implicit Dependencies
34 There are no implicit dependencies for target units.
35
36 Default Dependencies
37 The following dependencies are added unless DefaultDependencies=no is
38 set:
39
40 · Target units will automatically complement all configured
41 dependencies of type Wants= or Requires= with dependencies of type
42 After= unless DefaultDependencies=no is set in the specified units.
43 Note that Wants= or Requires= must be defined in the target unit
44 itself — if you for example define Wants=some.target in
45 some.service, the automatic ordering will not be added.
46
47 · Target units automatically gain Conflicts= and Before= dependencies
48 against shutdown.target.
49
51 Example 1. Simple standalone target
52
53 # emergency-net.target
54
55 [Unit]
56 Description=Emergency Mode with Networking
57 Requires=emergency.target systemd-networkd.service
58 After=emergency.target systemd-networkd.service
59 AllowIsolate=yes
60
61 When adding dependencies to other units, it's important to check if
62 they set DefaultDependencies=. Service units, unless they set
63 DefaultDependencies=no, automatically get a dependency on
64 sysinit.target. In this case, both emergency.target and
65 systemd-networkd.service have DefaultDependencies=no, so they are
66 suitable for use in this target, and do not pull in sysinit.target.
67
68 You can now switch into this emergency mode by running systemctl
69 isolate emergency-net.target or by passing the option
70 systemd.unit=emergency-net.target on the kernel command line.
71
72 Other units can have WantedBy=emergency-net.target in the [Install]
73 section. After they are enabled using systemctl enable, they will be
74 started before emergency-net.target is started. It is also possible to
75 add arbitrary units as dependencies of emergency.target without
76 modifying them by using systemctl add-wants.
77
79 systemd(1), systemctl(1), systemd.unit(5), systemd.special(7),
80 systemd.directives(7)
81
82
83
84systemd 245 SYSTEMD.TARGET(5)