Debian Codegraph @

upstream/fedora-44/man1/importctl.1

raw
1 '\" t
2 .TH "IMPORTCTL" "1" "" "systemd 259.5" "importctl"
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 importctl \- Download, import or export disk images
24 .SH "SYNOPSIS"
25 .HP \w'\fBimportctl\fR\ 'u
26 \fBimportctl\fR [OPTIONS...] {COMMAND} [NAME...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBimportctl\fR
30 may be used to download, import, and export disk images via
31 \fBsystemd-importd.service\fR(8)\&.
32 .PP
33 \fBimportctl\fR
34 operates both on block\-level disk images (such as DDIs) as well as file\-system\-level images (tarballs)\&. It supports disk images in one of the four following classes:
35 .sp
36 .RS 4
37 .ie n \{\
38 \h'-04'\(bu\h'+03'\c
39 .\}
40 .el \{\
41 .sp -1
42 .IP \(bu 2.3
43 .\}
44 VM images or full OS container images, that may be run via
45 \fBsystemd-vmspawn\fR(1)
46 or
47 \fBsystemd-nspawn\fR(1), and managed via
48 \fBmachinectl\fR(1)\&.
49 .RE
50 .sp
51 .RS 4
52 .ie n \{\
53 \h'-04'\(bu\h'+03'\c
54 .\}
55 .el \{\
56 .sp -1
57 .IP \(bu 2.3
58 .\}
59 Portable service images, that may be attached and managed via
60 \fBportablectl\fR(1)\&.
61 .RE
62 .sp
63 .RS 4
64 .ie n \{\
65 \h'-04'\(bu\h'+03'\c
66 .\}
67 .el \{\
68 .sp -1
69 .IP \(bu 2.3
70 .\}
71 System extension (sysext) images, that may be activated via
72 \fBsystemd-sysext\fR(8)\&.
73 .RE
74 .sp
75 .RS 4
76 .ie n \{\
77 \h'-04'\(bu\h'+03'\c
78 .\}
79 .el \{\
80 .sp -1
81 .IP \(bu 2.3
82 .\}
83 Configuration extension (confext) images, that may be activated via
84 \fBsystemd-confext\fR(8)\&.
85 .RE
86 .PP
87 When images are downloaded or imported they are placed in the following directories, depending on the
88 \fB\-\-class=\fR
89 parameter:
90 .sp
91 .it 1 an-trap
92 .nr an-no-space-flag 1
93 .nr an-break-flag 1
94 .br
95 .B Table\ \&1.\ \&Classes and Directories
96 .TS
97 allbox tab(:);
98 lB lB.
99 T{
100 Class
101 T}:T{
102 Directory
103 T}
104 .T&
105 l l
106 l l
107 l l
108 l l.
109 T{
110 "machine"
111 T}:T{
112 /var/lib/machines/
113 T}
114 T{
115 "portable"
116 T}:T{
117 /var/lib/portables/
118 T}
119 T{
120 "sysext"
121 T}:T{
122 /var/lib/extensions/
123 T}
124 T{
125 "confext"
126 T}:T{
127 /var/lib/confexts/
128 T}
129 .TE
130 .sp 1
131 .SH "COMMANDS"
132 .PP
133 The following commands are understood:
134 .PP
135 \fBpull\-tar\fR \fIURL\fR [\fINAME\fR]
136 .RS 4
137 Downloads a
138 \&.tar
139 image from the specified URL, and makes it available under the specified local name in the image directory for the selected
140 \fB\-\-class=\fR\&. The URL must be of type
141 "http://"
142 or
143 "https://", and must refer to a
144 \&.tar,
145 \&.tar\&.gz,
146 \&.tar\&.xz
147 or
148 \&.tar\&.bz2
149 archive file\&. If the local image name is omitted, it is automatically derived from the last component of the URL, with its suffix removed\&.
150 .sp
151 The image is verified before it is made available, unless
152 \fB\-\-verify=no\fR
153 is specified\&. Verification is done either via a file with the name of the image and the suffix
154 \&.sha256
155 and a detached
156 \&.sha256\&.asc
157 or
158 \&.sha256\&.gpg
159 signature or via separate
160 SHA256SUMS
161 and
162 SHA256SUMS\&.asc
163 or
164 SHA256SUMS\&.gpg
165 files\&. The signature files need to be made available on the same web server, under the same URL as the
166 \&.tar
167 file\&. With
168 \fB\-\-verify=checksum\fR, only the SHA256 checksum for the file is verified, based on the
169 \&.sha256
170 suffixed file or the
171 SHA256SUMS
172 file\&. With
173 \fB\-\-verify=signature\fR, the sha checksum file is first verified with the detached GPG signature of
174 \&.sha256
175 or
176 SHA256SUMS\&. The public key for this verification step needs to be available in
177 /usr/lib/systemd/import\-pubring\&.pgp
178 or
179 /etc/systemd/import\-pubring\&.pgp\&.
180 .sp
181 If
182 \fB\-keep\-download=yes\fR
183 is specified the image will be downloaded and stored in a read\-only subvolume/directory in the image directory that is named after the specified URL and its HTTP etag (see
184 \m[blue]\fBHTTP ETag\fR\m[]\&\s-2\u[1]\d\s+2
185 for more information)\&. A writable snapshot is then taken from this subvolume, and named after the specified local name\&. This behavior ensures that creating multiple instances of the same URL is efficient, as multiple downloads are not necessary\&. In order to create only the read\-only image, and avoid creating its writable snapshot, specify
186 "\-"
187 as local name\&.
188 .sp
189 Note that pressing Control\-c during execution of this command will not abort the download\&. Use
190 \fBcancel\-transfer\fR, described below\&.
191 .sp
192 Added in version 256\&.
193 .RE
194 .PP
195 \fBpull\-raw\fR \fIURL\fR [\fINAME\fR]
196 .RS 4
197 Downloads a
198 \&.raw
199 disk image from the specified URL, and makes it available under the specified local name in the image directory for the selected
200 \fB\-\-class=\fR\&. The URL must be of type
201 "http://"
202 or
203 "https://"\&. The image must either be a qcow2 or raw disk image, optionally compressed as
204 \&.gz,
205 \&.xz, or
206 \&.bz2\&. If the local name is omitted, it is automatically derived from the last component of the URL, with its suffix removed\&.
207 .sp
208 Image verification is identical for raw and tar images (see above)\&.
209 .sp
210 If the downloaded image is in qcow2 format it is converted into a raw image file before it is made available\&.
211 .sp
212 If
213 \fB\-keep\-download=yes\fR
214 is specified the image will be downloaded and stored in a read\-only file in the image directory that is named after the specified URL and its HTTP etag\&. A writable copy is then made from this file, and named after the specified local name\&. This behavior ensures that creating multiple instances of the same URL is efficient, as multiple downloads are not necessary\&. In order to create only the read\-only image, and avoid creating its writable copy, specify
215 "\-"
216 as local name\&.
217 .sp
218 Note that pressing Control\-c during execution of this command will not abort the download\&. Use
219 \fBcancel\-transfer\fR, described below\&.
220 .sp
221 Added in version 256\&.
222 .RE
223 .PP
224 \fBimport\-tar\fR \fIFILE\fR [\fINAME\fR], \fBimport\-raw\fR \fIFILE\fR [\fINAME\fR]
225 .RS 4
226 Imports a TAR or RAW image, and places it under the specified name in the image directory for the image class selected via
227 \fB\-\-class=\fR\&. When
228 \fBimport\-tar\fR
229 is used, the file specified as the first argument should be a
230 \fBtar\fR(1)
231 archive, possibly compressed with
232 \fBxz\fR(1),
233 \fBgzip\fR(1),
234 \fBzstd\fR(1), or
235 \fBbzip2\fR(1)\&. It will then be unpacked into its own subvolume/directory\&. When
236 \fBimport\-raw\fR
237 is used, the file should be a qcow2 or raw disk image, possibly compressed with xz, gzip, zstd or bzip2\&. If the second argument (the resulting image name) is not specified, it is automatically derived from the file name\&. If the filename is passed as
238 "\-", the image is read from standard input, in which case the second argument is mandatory\&.
239 .sp
240 No cryptographic validation is done when importing the images\&.
241 .sp
242 Much like image downloads, ongoing imports may be listed with
243 \fBlist\fR
244 and aborted with
245 \fBcancel\-transfer\fR\&.
246 .sp
247 Added in version 256\&.
248 .RE
249 .PP
250 \fBimport\-fs\fR \fIDIRECTORY\fR [\fINAME\fR]
251 .RS 4
252 Imports an image stored in a local directory into the image directory for the image class selected via
253 \fB\-\-class=\fR
254 and operates similarly to
255 \fBimport\-tar\fR
256 or
257 \fBimport\-raw\fR, but the first argument is the source directory\&. If supported, this command will create a
258 \fBbtrfs\fR(8)
259 snapshot or subvolume for the new image\&.
260 .sp
261 Added in version 256\&.
262 .RE
263 .PP
264 \fBexport\-tar\fR \fINAME\fR [\fIFILE\fR], \fBexport\-raw\fR \fINAME\fR [\fIFILE\fR]
265 .RS 4
266 Exports a TAR or RAW image and stores it in the specified file\&. The first parameter should be an image name\&. The second parameter should be a file path the TAR or RAW image is written to\&. If the path ends in
267 "\&.gz", the file is compressed with
268 \fBgzip\fR(1), if it ends in
269 "\&.xz", with
270 \fBxz\fR(1), if it ends in
271 "\&.zst", with
272 \fBzstd\fR(1), and if it ends in
273 "\&.bz2", with
274 \fBbzip2\fR(1)\&. If the path ends in neither, the file is left uncompressed\&. If the second argument is missing, the image is written to standard output\&. The compression may also be explicitly selected with the
275 \fB\-\-format=\fR
276 switch\&. This is in particular useful if the second parameter is left unspecified\&.
277 .sp
278 Much like image downloads and imports, ongoing exports may be listed with
279 \fBlist\fR
280 and aborted with
281 \fBcancel\-transfer\fR\&.
282 .sp
283 Note that, currently, only directory and subvolume images may be exported as TAR images, and only raw disk images as RAW images\&.
284 .sp
285 Added in version 256\&.
286 .RE
287 .PP
288 \fBlist\-transfer\fR
289 .RS 4
290 Shows a list of image downloads, imports and exports that are currently in progress\&.
291 .sp
292 Added in version 256\&.
293 .RE
294 .PP
295 \fBcancel\-transfer\fR \fIID\fR\&...
296 .RS 4
297 Aborts a download, import or export of the image with the specified ID\&. To list ongoing transfers and their IDs, use
298 \fBlist\fR\&.
299 .sp
300 Added in version 256\&.
301 .RE
302 .PP
303 \fBlist\-images\fR
304 .RS 4
305 Shows a list of already downloaded/imported images\&.
306 .sp
307 Added in version 256\&.
308 .RE
309 .SH "OPTIONS"
310 .PP
311 The following options are understood:
312 .PP
313 \fB\-\-read\-only\fR
314 .RS 4
315 When used with
316 \fBpull\-raw\fR,
317 \fBpull\-tar\fR,
318 \fBimport\-raw\fR,
319 \fBimport\-tar\fR
320 or
321 \fBimport\-fs\fR
322 a read\-only image is created\&.
323 .sp
324 Added in version 256\&.
325 .RE
326 .PP
327 \fB\-\-verify=\fR
328 .RS 4
329 When downloading an image, specify whether the image shall be verified before it is made available\&. Takes one of
330 "no",
331 "checksum"
332 and
333 "signature"\&. If
334 "no", no verification is done\&. If
335 "checksum"
336 is specified, the download is checked for integrity after the transfer is complete, but no signatures are verified\&. If
337 "signature"
338 is specified, the checksum is verified and the image\*(Aqs signature is checked against a local keyring of trustable vendors\&. It is strongly recommended to set this option to
339 "signature"
340 if the server and protocol support this\&. Defaults to
341 "signature"\&.
342 .sp
343 Added in version 256\&.
344 .RE
345 .PP
346 \fB\-\-force\fR
347 .RS 4
348 When downloading an image, and a local copy by the specified local name already exists, delete it first and replace it by the newly downloaded image\&.
349 .sp
350 Added in version 256\&.
351 .RE
352 .PP
353 \fB\-\-format=\fR
354 .RS 4
355 When used with the
356 \fBexport\-tar\fR
357 or
358 \fBexport\-raw\fR
359 commands, specifies the compression format to use for the resulting file\&. Takes one of
360 "uncompressed",
361 "xz",
362 "gzip",
363 "zst",
364 "bzip2"\&. By default, the format is determined automatically from the output image file name passed\&.
365 .sp
366 Added in version 256\&.
367 .RE
368 .PP
369 \fB\-q\fR, \fB\-\-quiet\fR
370 .RS 4
371 Suppresses additional informational output while running\&.
372 .sp
373 Added in version 256\&.
374 .RE
375 .PP
376 \fB\-H\fR, \fB\-\-host=\fR
377 .RS 4
378 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
379 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
380 ":", and then a container name, separated by
381 "/", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with
382 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
383 .RE
384 .PP
385 \fB\-M\fR, \fB\-\-machine=\fR
386 .RS 4
387 Connect to
388 \fBsystemd-importd.service\fR(8)
389 running in a local container, to perform the specified operation within the container\&.
390 .sp
391 Added in version 256\&.
392 .RE
393 .PP
394 \fB\-\-class=\fR, \fB\-m\fR, \fB\-P\fR, \fB\-S\fR, \fB\-C\fR
395 .RS 4
396 Selects the image class for the downloaded images\&. This primarily selects the directory to download into\&. The
397 \fB\-\-class=\fR
398 switch takes
399 "machine",
400 "portable",
401 "sysext"
402 or
403 "confext"
404 as argument\&. The short options
405 \fB\-m\fR,
406 \fB\-P\fR,
407 \fB\-S\fR,
408 \fB\-C\fR
409 are shortcuts for
410 \fB\-\-class=machine\fR,
411 \fB\-\-class=portable\fR,
412 \fB\-\-class=sysext\fR,
413 \fB\-\-class=confext\fR\&.
414 .sp
415 Note that
416 \fB\-\-keep\-download=\fR
417 defaults to true for
418 \fB\-\-class=machine\fR
419 and false otherwise, see below\&.
420 .sp
421 Added in version 256\&.
422 .RE
423 .PP
424 \fB\-\-keep\-download=\fR, \fB\-N\fR
425 .RS 4
426 Takes a boolean argument\&. When specified with
427 \fBpull\-raw\fR
428 or
429 \fBpull\-tar\fR, selects whether to download directly into the specified local image name, or whether to download into a read\-only copy first of which to make a writable copy after the download is completed\&. Defaults to true for
430 \fB\-\-class=machine\fR, false otherwise\&.
431 .sp
432 The
433 \fB\-N\fR
434 switch is a shortcut for
435 \fB\-\-keep\-download=no\fR\&.
436 .sp
437 Added in version 256\&.
438 .RE
439 .PP
440 \fB\-\-json=\fR\fB\fIMODE\fR\fR
441 .RS 4
442 Shows output formatted as JSON\&. Expects one of
443 "short"
444 (for the shortest possible output without any redundant whitespace or line breaks),
445 "pretty"
446 (for a pretty version of the same, with indentation and line breaks) or
447 "off"
448 (to turn off JSON output, the default)\&.
449 .RE
450 .PP
451 \fB\-j\fR
452 .RS 4
453 Equivalent to
454 \fB\-\-json=pretty\fR
455 if running on a terminal, and
456 \fB\-\-json=short\fR
457 otherwise\&.
458 .RE
459 .PP
460 \fB\-\-no\-pager\fR
461 .RS 4
462 Do not pipe output into a pager\&.
463 .RE
464 .PP
465 \fB\-\-no\-legend\fR
466 .RS 4
467 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
468 .RE
469 .PP
470 \fB\-\-no\-ask\-password\fR
471 .RS 4
472 Do not query the user for authentication for privileged operations\&.
473 .RE
474 .PP
475 \fB\-h\fR, \fB\-\-help\fR
476 .RS 4
477 Print a short help text and exit\&.
478 .RE
479 .PP
480 \fB\-\-version\fR
481 .RS 4
482 Print a short version string and exit\&.
483 .RE
484 .SH "EXAMPLES"
485 .PP
486 \fBExample\ \&1.\ \&Download an Ubuntu TAR image and open a shell in it\fR
487 .sp
488 .if n \{\
489 .RS 4
490 .\}
491 .nf
492 # importctl pull\-tar \-mN https://cloud\-images\&.ubuntu\&.com/jammy/current/jammy\-server\-cloudimg\-amd64\-root\&.tar\&.xz
493 # systemd\-nspawn \-M jammy\-server\-cloudimg\-amd64\-root
494 .fi
495 .if n \{\
496 .RE
497 .\}
498 .PP
499 This downloads and verifies the specified
500 \&.tar
501 image, and then uses
502 \fBsystemd-nspawn\fR(1)
503 to open a shell in it\&.
504 .PP
505 \fBExample\ \&2.\ \&Download an Ubuntu RAW image, set a root password in it, start it as a service\fR
506 .sp
507 .if n \{\
508 .RS 4
509 .\}
510 .nf
511 # importctl pull\-raw \-mN \e
512 https://cloud\-images\&.ubuntu\&.com/jammy/current/jammy\-server\-cloudimg\-amd64\-disk\-kvm\&.img \e
513 jammy
514 # systemd\-firstboot \-\-image=/var/lib/machines/jammy\&.raw \-\-prompt\-root\-password \-\-force
515 # machinectl start jammy
516 # machinectl login jammy
517 .fi
518 .if n \{\
519 .RE
520 .\}
521 .PP
522 This downloads the specified
523 \&.raw
524 image and makes it available under the local name
525 "jammy"\&. Then, a root password is set with
526 \fBsystemd-firstboot\fR(1)\&. Afterwards the machine is started as system service\&. With the last command a login prompt into the container is requested\&.
527 .PP
528 \fBExample\ \&3.\ \&Exports a container image as tar file\fR
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 # importctl export\-tar \-m fedora myfedora\&.tar\&.xz
535 .fi
536 .if n \{\
537 .RE
538 .\}
539 .PP
540 Exports the container
541 "fedora"
542 as an xz\-compressed tar file
543 myfedora\&.tar\&.xz
544 into the current directory\&.
545 .SH "EXIT STATUS"
546 .PP
547 On success, 0 is returned, a non\-zero failure code otherwise\&.
548 .SH "ENVIRONMENT"
549 .PP
550 \fI$SYSTEMD_LOG_LEVEL\fR
551 .RS 4
552 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
553 \fBemerg\fR,
554 \fBalert\fR,
555 \fBcrit\fR,
556 \fBerr\fR,
557 \fBwarning\fR,
558 \fBnotice\fR,
559 \fBinfo\fR,
560 \fBdebug\fR, or an integer in the range 0\&...7\&. See
561 \fBsyslog\fR(3)
562 for more information\&. Each value may optionally be prefixed with one of
563 \fBconsole\fR,
564 \fBsyslog\fR,
565 \fBkmsg\fR
566 or
567 \fBjournal\fR
568 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
569 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
570 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
571 .RE
572 .PP
573 \fI$SYSTEMD_LOG_COLOR\fR
574 .RS 4
575 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
576 .sp
577 This setting is only useful when messages are written directly to the terminal, because
578 \fBjournalctl\fR(1)
579 and other tools that display logs will color messages based on the log level on their own\&.
580 .RE
581 .PP
582 \fI$SYSTEMD_LOG_TIME\fR
583 .RS 4
584 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
585 .sp
586 This setting is only useful when messages are written directly to the terminal or a file, because
587 \fBjournalctl\fR(1)
588 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
589 .RE
590 .PP
591 \fI$SYSTEMD_LOG_LOCATION\fR
592 .RS 4
593 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
594 .sp
595 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
596 .RE
597 .PP
598 \fI$SYSTEMD_LOG_TID\fR
599 .RS 4
600 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
601 .sp
602 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
603 .RE
604 .PP
605 \fI$SYSTEMD_LOG_TARGET\fR
606 .RS 4
607 The destination for log messages\&. One of
608 \fBconsole\fR
609 (log to the attached tty),
610 \fBconsole\-prefixed\fR
611 (log to the attached tty but with prefixes encoding the log level and "facility", see
612 \fBsyslog\fR(3),
613 \fBkmsg\fR
614 (log to the kernel circular log buffer),
615 \fBjournal\fR
616 (log to the journal),
617 \fBjournal\-or\-kmsg\fR
618 (log to the journal if available, and to kmsg otherwise),
619 \fBauto\fR
620 (determine the appropriate log target automatically, the default),
621 \fBnull\fR
622 (disable log output)\&.
623 .RE
624 .PP
625 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
626 .RS 4
627 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
628 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
629 .RE
630 .PP
631 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
632 .RS 4
633 Pager to use when
634 \fB\-\-no\-pager\fR
635 is not given\&.
636 \fI$SYSTEMD_PAGER\fR
637 is used if set; otherwise
638 \fI$PAGER\fR
639 is used\&. If neither
640 \fI$SYSTEMD_PAGER\fR
641 nor
642 \fI$PAGER\fR
643 are set, a set of well\-known pager implementations is tried in turn, including
644 \fBless\fR(1)
645 and
646 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
647 "cat"
648 is equivalent to passing
649 \fB\-\-no\-pager\fR\&.
650 .sp
651 Note: if
652 \fI$SYSTEMD_PAGERSECURE\fR
653 is not set,
654 \fI$SYSTEMD_PAGER\fR
655 and
656 \fI$PAGER\fR
657 can only be used to disable the pager (with
658 "cat"
659 or
660 ""), and are otherwise ignored\&.
661 .RE
662 .PP
663 \fI$SYSTEMD_LESS\fR
664 .RS 4
665 Override the options passed to
666 \fBless\fR
667 (by default
668 "FRSXMK")\&.
669 .sp
670 Users might want to change two options in particular:
671 .PP
672 \fBK\fR
673 .RS 4
674 This option instructs the pager to exit immediately when
675 Ctrl+C
676 is pressed\&. To allow
677 \fBless\fR
678 to handle
679 Ctrl+C
680 itself to switch back to the pager command prompt, unset this option\&.
681 .sp
682 If the value of
683 \fI$SYSTEMD_LESS\fR
684 does not include
685 "K", and the pager that is invoked is
686 \fBless\fR,
687 Ctrl+C
688 will be ignored by the executable, and needs to be handled by the pager\&.
689 .RE
690 .PP
691 \fBX\fR
692 .RS 4
693 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
694 .RE
695 .sp
696 Note that setting the regular
697 \fI$LESS\fR
698 environment variable has no effect for
699 \fBless\fR
700 invocations by systemd tools\&.
701 .sp
702 See
703 \fBless\fR(1)
704 for more discussion\&.
705 .RE
706 .PP
707 \fI$SYSTEMD_LESSCHARSET\fR
708 .RS 4
709 Override the charset passed to
710 \fBless\fR
711 (by default
712 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
713 .sp
714 Note that setting the regular
715 \fI$LESSCHARSET\fR
716 environment variable has no effect for
717 \fBless\fR
718 invocations by systemd tools\&.
719 .RE
720 .PP
721 \fI$SYSTEMD_PAGERSECURE\fR
722 .RS 4
723 Common pager commands like
724 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
725 \fBsudo\fR(8)
726 or
727 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
728 \fIif the pager supports that\fR
729 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
730 \fB\-\-no\-pager\fR
731 or
732 \fIPAGER=cat\fR
733 when allowing untrusted users to execute commands with elevated privileges\&.
734 .sp
735 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
736 \fBLESSSECURE=1\fR
737 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
738 \fBless\fR(1)
739 is known to understand this variable and implement "secure mode"\&.
740 .sp
741 When set to false, no limitation is placed on the pager\&. Setting
742 \fISYSTEMD_PAGERSECURE=0\fR
743 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
744 .sp
745 When
746 \fI$SYSTEMD_PAGERSECURE\fR
747 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
748 \fBgeteuid\fR(2)
749 and
750 \fBsd_pid_get_owner_uid\fR(3), or when running under
751 \fBsudo\fR(8)
752 or similar tools (\fI$SUDO_UID\fR
753 is set
754 \&\s-2\u[2]\d\s+2)\&. In those cases,
755 \fISYSTEMD_PAGERSECURE=1\fR
756 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
757 \fI$SYSTEMD_PAGERSECURE\fR
758 or disable the pager\&.
759 .sp
760 Note that if the
761 \fI$SYSTEMD_PAGER\fR
762 or
763 \fI$PAGER\fR
764 variables are to be honoured, other than to disable the pager,
765 \fI$SYSTEMD_PAGERSECURE\fR
766 must be set too\&.
767 .RE
768 .PP
769 \fI$SYSTEMD_COLORS\fR
770 .RS 4
771 Takes a boolean argument\&. When true,
772 \fBsystemd\fR
773 and related utilities will use colors in their output, otherwise the output will be monochrome\&. Additionally, the variable can take one of the following special values:
774 "16",
775 "256"
776 to restrict the use of colors to the base 16 or 256 ANSI colors, respectively\&. This can be specified to override the automatic decision based on
777 \fI$TERM\fR
778 and what the console is connected to\&.
779 .RE
780 .PP
781 \fI$SYSTEMD_URLIFY\fR
782 .RS 4
783 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
784 \fBsystemd\fR
785 makes based on
786 \fI$TERM\fR
787 and other conditions\&.
788 .RE
789 .SH "SEE ALSO"
790 .PP
791 \fBsystemd\fR(1), \fBsystemd-importd.service\fR(8), \fBsystemd-nspawn\fR(1), \fBsystemd-vmspawn\fR(1), \fBmachinectl\fR(1), \fBportablectl\fR(1), \fBsystemd-sysext\fR(8), \fBsystemd-confext\fR(8), \fBtar\fR(1), \fBxz\fR(1), \fBgzip\fR(1), \fBzstd\fR(1), \fBbzip2\fR(1)
792 .SH "NOTES"
793 .IP " 1." 4
794 HTTP ETag
795 .RS 4
796 \%https://en.wikipedia.org/wiki/HTTP_ETag
797 .RE
798 .IP " 2." 4
799 It is recommended for other tools to set and check
800 \fI$SUDO_UID\fR
801 as appropriate, treating it is a common interface.
802