summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man7/systemd.v.7
blob: 29139560243d3d921c287ec4a2c54a9914d13137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
'\" t
.TH "SYSTEMD\&.V" "7" "" "systemd 256~rc3" "systemd.v"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd.v \- Directory with Versioned Resources
.SH "DESCRIPTION"
.PP
In various places systemd components accept paths whose trailing components have the
"\&.v/"
suffix, pointing to a directory\&. These components will then automatically look for suitable files inside the directory, do a version comparison and open the newest file found (by version)\&. Available since version v256\&. Specifically, two expressions are supported:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
When looking for files with a suffix
\fI\&.SUFFIX\fR, and a path
\&...\fIPATH\fR/\fINAME\fR\fI\&.SUFFIX\fR\&.v/
is specified, then all files
\&...\fIPATH\fR/\fINAME\fR\fI\&.SUFFIX\fR\&.v/\fINAME\fR_*\fI\&.SUFFIX\fR
are enumerated, filtered, sorted and the newest file used\&. The primary sorting key is the
\fIvariable part\fR, here indicated by the wildcard
"*"\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
When a path
\&...\fIPATH\fR\&.v/\fINAME\fR___\fI\&.SUFFIX\fR
is specified (i\&.e\&. the penultimate component of the path ends in
"\&.v"
and the final component contains a triple underscore), then all files
\&...\fIPATH\fR\&.v/\fINAME\fR_*\fI\&.SUFFIX\fR
are enumerated, filtered, sorted and the newest file used (again, by the
\fIvariable part\fR, here indicated by the wildcard
"*")\&.
.RE
.PP
To illustrate this in an example, consider a directory
/var/lib/machines/mymachine\&.raw\&.v/, which is populated with three files:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.5\&.13\&.raw
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.5\&.14\&.raw
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.6\&.0\&.raw
.RE
.PP
Invoke a tool such as
\fBsystemd-nspawn\fR(1)
with a command line like the following:
.sp
.if n \{\
.RS 4
.\}
.nf
# systemd\-nspawn \-\-image=/var/lib/machines/mymachine\&.raw\&.v \-\-boot
.fi
.if n \{\
.RE
.\}
.PP
Then this would automatically be resolved to the equivalent of:
.sp
.if n \{\
.RS 4
.\}
.nf
# systemd\-nspawn \-\-image=/var/lib/machines/mymachine\&.raw\&.v/mymachine_7\&.6\&.0\&.raw \-\-boot
.fi
.if n \{\
.RE
.\}
.PP
Much of systemd\*(Aqs functionality that expects a path to a disk image or OS directory hierarchy support the
"\&.v/"
versioned directory mechanism, for example
\fBsystemd-nspawn\fR(1),
\fBsystemd-dissect\fR(1)
or the
\fIRootDirectory=\fR/\fIRootImage=\fR
settings of service files (see
\fBsystemd.exec\fR(5))\&.
.PP
Use the
\fBsystemd-vpick\fR(1)
tool to resolve
"\&.v/"
paths from the command line, for example for usage in shell scripts\&.
.SH "FILTERING AND SORTING"
.PP
The variable part of the filenames in the
"\&.v/"
directories are filtered and compared primarily with a version comparison, implementing
\m[blue]\fBVersion Format Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. However, additional rules apply:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
If the variable part is suffixed by one or two integer values ("tries left" and "tries done") in the formats
+\fILEFT\fR
or
+\fILEFT\fR\-\fIDONE\fR, then these indicate usage attempt counters\&. The idea is that each time before a file is attempted to be used, its "tries left" counter is decreased, and the "tries done" counter increased (simply by renaming the file)\&. When the file is successfully used (which for example could mean for an OS image: successfully booted) the counters are removed from the file name, indicating that the file has been validated to work correctly\&. This mechanism mirrors the boot assessment counters defined by
\m[blue]\fBAutomatic Boot Assessment\fR\m[]\&\s-2\u[2]\d\s+2\&. Any filenames with no boot counters or with a non\-zero "tries left" counter are sorted before filenames with a zero "tries left" counter\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Preceding the use counters (if they are specified), an optional CPU architecture identifier may be specified in the filename (separated from the version with an underscore), as defined in the architecture vocabulary of the
\fIConditionArchitecture=\fR
unit file setting, as documented in
\fBsystemd.unit\fR(5)\&. Files whose name indicates an architecture not supported locally are filtered and not considered for the version comparison\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The rest of the variable part is the version string\&.
.RE
.PP
Or in other words, the files in the
"\&.v/"
directories should follow one of these naming structures:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR\fI\&.SUFFIX\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR_\fIARCHITECTURE\fR\fI\&.SUFFIX\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR+\fILEFT\fR\fI\&.SUFFIX\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR+\fILEFT\fR\-\fIDONE\fR\fI\&.SUFFIX\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR_\fIARCHITECTURE\fR+\fILEFT\fR\fI\&.SUFFIX\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fINAME\fR_\fIVERSION\fR_\fIARCHITECTURE\fR+\fILEFT\fR\-\fIDONE\fR\fI\&.SUFFIX\fR
.RE
.SH "EXAMPLE"
.PP
Here\*(Aqs a more comprehensive example, further extending the one described above\&. Consider a directory
/var/lib/machines/mymachine\&.raw\&.v/, which is populated with the following files:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.5\&.13\&.raw
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.5\&.14_x86\-64\&.raw
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.6\&.0_arm64\&.raw
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mymachine_7\&.7\&.0_x86\-64+0\-5\&.raw
.RE
.PP
Now invoke the following command on an x86\-64 machine:
.sp
.if n \{\
.RS 4
.\}
.nf
$ systemd\-vpick \-\-suffix=\&.raw /var/lib/machines/mymachine\&.raw\&.v/
.fi
.if n \{\
.RE
.\}
.PP
This would resolve the specified path to
/var/lib/machines/mymachine\&.raw\&.v/mymachine_7\&.5\&.14_x86\-64\&.raw\&. Explanation: even though
mymachine_7\&.7\&.0_x86\-64+0\-5\&.raw
has the newest version, it is not preferred because its tries left counter is zero\&. And even though
mymachine_7\&.6\&.0_arm64\&.raw
has the second newest version it is also not considered, in this case because we operate on an x86_64 system and the image is intended for arm64 CPUs\&. Finally, the
mymachine_7\&.5\&.13\&.raw
image is not considered because it is older than
mymachine_7\&.5\&.14_x86\-64\&.raw\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1), \fBsystemd-vpick\fR(1), \fBsystemd-nspawn\fR(1), \fBsystemd-dissect\fR(1), \fBsystemd.exec\fR(5), \fBsystemd-sysupdate\fR(1)
.SH "NOTES"
.IP " 1." 4
Version Format Specification
.RS 4
\%https://uapi-group.org/specifications/specs/version_format_specification/
.RE
.IP " 2." 4
Automatic Boot Assessment
.RS 4
\%https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/
.RE