Debian Codegraph @

upstream/debian-unstable/man5/systemd.target.5

raw
1 '\" t
2 .TH "SYSTEMD\&.TARGET" "5" "" "systemd 261~rc3" "systemd.target"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.target \- Target unit configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fItarget\fR\&.target
27 .SH "DESCRIPTION"
28 .PP
29 A unit configuration file whose name ends in
30 "\&.target"
31 encodes information about a target unit of systemd\&. Target units are used to group units and to set synchronization points for ordering dependencies with other unit files\&.
32 .PP
33 This unit type has no specific options\&. See
34 \fBsystemd.unit\fR(5)
35 for the common options of all unit configuration files\&. The common configuration items are configured in the generic [Unit] and [Install] sections\&. A separate [Target] section does not exist, since no target\-specific options may be configured\&.
36 .PP
37 Target units do not offer any additional functionality on top of the generic functionality provided by units\&. They merely group units, allowing a single target name to be used in
38 \fIWants=\fR
39 and
40 \fIRequires=\fR
41 settings to establish a dependency on a set of units defined by the target, and in
42 \fIBefore=\fR
43 and
44 \fIAfter=\fR
45 settings to establish ordering\&. Targets establish standardized names for synchronization points during boot and shutdown\&. Importantly, see
46 \fBsystemd.special\fR(7)
47 for examples and descriptions of standard systemd targets\&.
48 .PP
49 Target units provide a more flexible replacement for SysV runlevels in the classic SysV init system\&.
50 .PP
51 Note that a target unit file must not be empty, lest it be considered a masked unit\&. It is recommended to provide a [Unit] section which includes informative
52 \fIDescription=\fR
53 and
54 \fIDocumentation=\fR
55 options\&.
56 .SH "AUTOMATIC DEPENDENCIES"
57 .SS "Implicit Dependencies"
58 .PP
59 There are no implicit dependencies for target units\&.
60 .SS "Default Dependencies"
61 .PP
62 The following dependencies are added unless
63 \fIDefaultDependencies=no\fR
64 is set:
65 .sp
66 .RS 4
67 .ie n \{\
68 \h'-04'\(bu\h'+03'\c
69 .\}
70 .el \{\
71 .sp -1
72 .IP \(bu 2.3
73 .\}
74 Target units will automatically complement all configured dependencies of type
75 \fIWants=\fR
76 or
77 \fIRequires=\fR
78 with dependencies of type
79 \fIAfter=\fR
80 unless
81 \fIDefaultDependencies=no\fR
82 is set in the specified units\&.
83 .sp
84 Note that the reverse is not true\&. For example, defining
85 \fBWants=that\&.target\fR
86 in
87 some\&.service
88 will not automatically add the
89 \fBAfter=that\&.target\fR
90 ordering dependency for
91 some\&.service\&. Instead,
92 some\&.service
93 should use the primary synchronization function of target type units, by setting a specific
94 \fBAfter=that\&.target\fR
95 or
96 \fBBefore=that\&.target\fR
97 ordering dependency in its \&.service unit file\&.
98 .RE
99 .sp
100 .RS 4
101 .ie n \{\
102 \h'-04'\(bu\h'+03'\c
103 .\}
104 .el \{\
105 .sp -1
106 .IP \(bu 2.3
107 .\}
108 Target units automatically gain
109 \fIConflicts=\fR
110 and
111 \fIBefore=\fR
112 dependencies against
113 shutdown\&.target\&.
114 .RE
115 .SH "OPTIONS"
116 .PP
117 Target unit files may include [Unit] and [Install] sections, which are described in
118 \fBsystemd.unit\fR(5)\&. No options specific to this file type are supported\&.
119 .SH "EXAMPLE"
120 .PP
121 \fBExample\ \&1.\ \&Simple standalone target\fR
122 .sp
123 .if n \{\
124 .RS 4
125 .\}
126 .nf
127 # emergency\-net\&.target
128
129 [Unit]
130 Description=Emergency Mode with Networking
131 Requires=emergency\&.target systemd\-networkd\&.service
132 After=emergency\&.target systemd\-networkd\&.service
133 AllowIsolate=yes
134 .fi
135 .if n \{\
136 .RE
137 .\}
138 .PP
139 When adding dependencies to other units, it is important to check if they set
140 \fIDefaultDependencies=\fR\&. Service units, unless they set
141 \fIDefaultDependencies=no\fR, automatically get a dependency on
142 sysinit\&.target\&. In this case, both
143 emergency\&.target
144 and
145 systemd\-networkd\&.service
146 have
147 \fIDefaultDependencies=no\fR, so they are suitable for use in this target, and do not pull in
148 sysinit\&.target\&.
149 .PP
150 You can now switch into this emergency mode by running
151 \fIsystemctl isolate emergency\-net\&.target\fR
152 or by passing the option
153 \fIsystemd\&.unit=emergency\-net\&.target\fR
154 on the kernel command line\&.
155 .PP
156 Other units can have
157 \fIWantedBy=emergency\-net\&.target\fR
158 in the
159 \fI[Install]\fR
160 section\&. After they are enabled using
161 \fBsystemctl enable\fR, they will be started before
162 \fIemergency\-net\&.target\fR
163 is started\&. It is also possible to add arbitrary units as dependencies of
164 emergency\&.target
165 without modifying them by using
166 \fBsystemctl add\-wants\fR\&.
167 .SH "SEE ALSO"
168 .PP
169 \fBsystemd\fR(1), \fBsystemctl\fR(1), \fBsystemd.unit\fR(5), \fBsystemd.special\fR(7), \fBsystemd.directives\fR(7)