Debian Codegraph @

upstream/opensuse-leap-16-1/man1/importctl.1

raw
1 '\" t
2 .TH "IMPORTCTL" "1" "" "systemd 257.13" "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\&.gpg
178 or
179 /etc/systemd/import\-pubring\&.gpg\&.
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), or
234 \fBbzip2\fR(1)\&. It will then be unpacked into its own subvolume/directory\&. When
235 \fBimport\-raw\fR
236 is used, the file should be a qcow2 or raw disk image, possibly compressed with xz, gzip 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
237 "\-", the image is read from standard input, in which case the second argument is mandatory\&.
238 .sp
239 No cryptographic validation is done when importing the images\&.
240 .sp
241 Much like image downloads, ongoing imports may be listed with
242 \fBlist\fR
243 and aborted with
244 \fBcancel\-transfer\fR\&.
245 .sp
246 Added in version 256\&.
247 .RE
248 .PP
249 \fBimport\-fs\fR \fIDIRECTORY\fR [\fINAME\fR]
250 .RS 4
251 Imports an image stored in a local directory into the image directory for the image class selected via
252 \fB\-\-class=\fR
253 and operates similarly to
254 \fBimport\-tar\fR
255 or
256 \fBimport\-raw\fR, but the first argument is the source directory\&. If supported, this command will create a
257 \fBbtrfs\fR(8)
258 snapshot or subvolume for the new image\&.
259 .sp
260 Added in version 256\&.
261 .RE
262 .PP
263 \fBexport\-tar\fR \fINAME\fR [\fIFILE\fR], \fBexport\-raw\fR \fINAME\fR [\fIFILE\fR]
264 .RS 4
265 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
266 "\&.gz", the file is compressed with
267 \fBgzip\fR(1), if it ends in
268 "\&.xz", with
269 \fBxz\fR(1), and if it ends in
270 "\&.bz2", with
271 \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
272 \fB\-\-format=\fR
273 switch\&. This is in particular useful if the second parameter is left unspecified\&.
274 .sp
275 Much like image downloads and imports, ongoing exports may be listed with
276 \fBlist\fR
277 and aborted with
278 \fBcancel\-transfer\fR\&.
279 .sp
280 Note that, currently, only directory and subvolume images may be exported as TAR images, and only raw disk images as RAW images\&.
281 .sp
282 Added in version 256\&.
283 .RE
284 .PP
285 \fBlist\-transfer\fR
286 .RS 4
287 Shows a list of image downloads, imports and exports that are currently in progress\&.
288 .sp
289 Added in version 256\&.
290 .RE
291 .PP
292 \fBcancel\-transfer\fR \fIID\fR\&...
293 .RS 4
294 Aborts a download, import or export of the image with the specified ID\&. To list ongoing transfers and their IDs, use
295 \fBlist\fR\&.
296 .sp
297 Added in version 256\&.
298 .RE
299 .PP
300 \fBlist\-images\fR
301 .RS 4
302 Shows a list of already downloaded/imported images\&.
303 .sp
304 Added in version 256\&.
305 .RE
306 .SH "OPTIONS"
307 .PP
308 The following options are understood:
309 .PP
310 \fB\-\-read\-only\fR
311 .RS 4
312 When used with
313 \fBpull\-raw\fR,
314 \fBpull\-tar\fR,
315 \fBimport\-raw\fR,
316 \fBimport\-tar\fR
317 or
318 \fBimport\-fs\fR
319 a read\-only image is created\&.
320 .sp
321 Added in version 256\&.
322 .RE
323 .PP
324 \fB\-\-verify=\fR
325 .RS 4
326 When downloading an image, specify whether the image shall be verified before it is made available\&. Takes one of
327 "no",
328 "checksum"
329 and
330 "signature"\&. If
331 "no", no verification is done\&. If
332 "checksum"
333 is specified, the download is checked for integrity after the transfer is complete, but no signatures are verified\&. If
334 "signature"
335 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
336 "signature"
337 if the server and protocol support this\&. Defaults to
338 "signature"\&.
339 .sp
340 Added in version 256\&.
341 .RE
342 .PP
343 \fB\-\-force\fR
344 .RS 4
345 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\&.
346 .sp
347 Added in version 256\&.
348 .RE
349 .PP
350 \fB\-\-format=\fR
351 .RS 4
352 When used with the
353 \fBexport\-tar\fR
354 or
355 \fBexport\-raw\fR
356 commands, specifies the compression format to use for the resulting file\&. Takes one of
357 "uncompressed",
358 "xz",
359 "gzip",
360 "bzip2"\&. By default, the format is determined automatically from the output image file name passed\&.
361 .sp
362 Added in version 256\&.
363 .RE
364 .PP
365 \fB\-q\fR, \fB\-\-quiet\fR
366 .RS 4
367 Suppresses additional informational output while running\&.
368 .sp
369 Added in version 256\&.
370 .RE
371 .PP
372 \fB\-H\fR, \fB\-\-host=\fR
373 .RS 4
374 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
375 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
376 ":", and then a container name, separated by
377 "/", 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
378 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
379 .RE
380 .PP
381 \fB\-M\fR, \fB\-\-machine=\fR
382 .RS 4
383 Connect to
384 \fBsystemd-importd.service\fR(8)
385 running in a local container, to perform the specified operation within the container\&.
386 .sp
387 Added in version 256\&.
388 .RE
389 .PP
390 \fB\-\-class=\fR, \fB\-m\fR, \fB\-P\fR, \fB\-S\fR, \fB\-C\fR
391 .RS 4
392 Selects the image class for the downloaded images\&. This primarily selects the directory to download into\&. The
393 \fB\-\-class=\fR
394 switch takes
395 "machine",
396 "portable",
397 "sysext"
398 or
399 "confext"
400 as argument\&. The short options
401 \fB\-m\fR,
402 \fB\-P\fR,
403 \fB\-S\fR,
404 \fB\-C\fR
405 are shortcuts for
406 \fB\-\-class=machine\fR,
407 \fB\-\-class=portable\fR,
408 \fB\-\-class=sysext\fR,
409 \fB\-\-class=confext\fR\&.
410 .sp
411 Note that
412 \fB\-\-keep\-download=\fR
413 defaults to true for
414 \fB\-\-class=machine\fR
415 and false otherwise, see below\&.
416 .sp
417 Added in version 256\&.
418 .RE
419 .PP
420 \fB\-\-keep\-download=\fR, \fB\-N\fR
421 .RS 4
422 Takes a boolean argument\&. When specified with
423 \fBpull\-raw\fR
424 or
425 \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
426 \fB\-\-class=machine\fR, false otherwise\&.
427 .sp
428 The
429 \fB\-N\fR
430 switch is a shortcut for
431 \fB\-\-keep\-download=no\fR\&.
432 .sp
433 Added in version 256\&.
434 .RE
435 .PP
436 \fB\-\-json=\fR\fB\fIMODE\fR\fR
437 .RS 4
438 Shows output formatted as JSON\&. Expects one of
439 "short"
440 (for the shortest possible output without any redundant whitespace or line breaks),
441 "pretty"
442 (for a pretty version of the same, with indentation and line breaks) or
443 "off"
444 (to turn off JSON output, the default)\&.
445 .RE
446 .PP
447 \fB\-j\fR
448 .RS 4
449 Equivalent to
450 \fB\-\-json=pretty\fR
451 if running on a terminal, and
452 \fB\-\-json=short\fR
453 otherwise\&.
454 .RE
455 .PP
456 \fB\-\-no\-pager\fR
457 .RS 4
458 Do not pipe output into a pager\&.
459 .RE
460 .PP
461 \fB\-\-no\-legend\fR
462 .RS 4
463 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
464 .RE
465 .PP
466 \fB\-\-no\-ask\-password\fR
467 .RS 4
468 Do not query the user for authentication for privileged operations\&.
469 .RE
470 .PP
471 \fB\-h\fR, \fB\-\-help\fR
472 .RS 4
473 Print a short help text and exit\&.
474 .RE
475 .PP
476 \fB\-\-version\fR
477 .RS 4
478 Print a short version string and exit\&.
479 .RE
480 .SH "EXAMPLES"
481 .PP
482 \fBExample\ \&1.\ \&Download an Ubuntu TAR image and open a shell in it\fR
483 .sp
484 .if n \{\
485 .RS 4
486 .\}
487 .nf
488 # importctl pull\-tar \-mN https://cloud\-images\&.ubuntu\&.com/jammy/current/jammy\-server\-cloudimg\-amd64\-root\&.tar\&.xz
489 # systemd\-nspawn \-M jammy\-server\-cloudimg\-amd64\-root
490 .fi
491 .if n \{\
492 .RE
493 .\}
494 .PP
495 This downloads and verifies the specified
496 \&.tar
497 image, and then uses
498 \fBsystemd-nspawn\fR(1)
499 to open a shell in it\&.
500 .PP
501 \fBExample\ \&2.\ \&Download an Ubuntu RAW image, set a root password in it, start it as a service\fR
502 .sp
503 .if n \{\
504 .RS 4
505 .\}
506 .nf
507 # importctl pull\-raw \-mN \e
508 https://cloud\-images\&.ubuntu\&.com/jammy/current/jammy\-server\-cloudimg\-amd64\-disk\-kvm\&.img \e
509 jammy
510 # systemd\-firstboot \-\-image=/var/lib/machines/jammy\&.raw \-\-prompt\-root\-password \-\-force
511 # machinectl start jammy
512 # machinectl login jammy
513 .fi
514 .if n \{\
515 .RE
516 .\}
517 .PP
518 This downloads the specified
519 \&.raw
520 image and makes it available under the local name
521 "jammy"\&. Then, a root password is set with
522 \fBsystemd-firstboot\fR(1)\&. Afterwards the machine is started as system service\&. With the last command a login prompt into the container is requested\&.
523 .PP
524 \fBExample\ \&3.\ \&Exports a container image as tar file\fR
525 .sp
526 .if n \{\
527 .RS 4
528 .\}
529 .nf
530 # importctl export\-tar \-m fedora myfedora\&.tar\&.xz
531 .fi
532 .if n \{\
533 .RE
534 .\}
535 .PP
536 Exports the container
537 "fedora"
538 as an xz\-compressed tar file
539 myfedora\&.tar\&.xz
540 into the current directory\&.
541 .SH "EXIT STATUS"
542 .PP
543 On success, 0 is returned, a non\-zero failure code otherwise\&.
544 .SH "ENVIRONMENT"
545 .PP
546 \fI$SYSTEMD_LOG_LEVEL\fR
547 .RS 4
548 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)
549 \fBemerg\fR,
550 \fBalert\fR,
551 \fBcrit\fR,
552 \fBerr\fR,
553 \fBwarning\fR,
554 \fBnotice\fR,
555 \fBinfo\fR,
556 \fBdebug\fR, or an integer in the range 0\&...7\&. See
557 \fBsyslog\fR(3)
558 for more information\&. Each value may optionally be prefixed with one of
559 \fBconsole\fR,
560 \fBsyslog\fR,
561 \fBkmsg\fR
562 or
563 \fBjournal\fR
564 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
565 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
566 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\&.
567 .RE
568 .PP
569 \fI$SYSTEMD_LOG_COLOR\fR
570 .RS 4
571 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
572 .sp
573 This setting is only useful when messages are written directly to the terminal, because
574 \fBjournalctl\fR(1)
575 and other tools that display logs will color messages based on the log level on their own\&.
576 .RE
577 .PP
578 \fI$SYSTEMD_LOG_TIME\fR
579 .RS 4
580 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
581 .sp
582 This setting is only useful when messages are written directly to the terminal or a file, because
583 \fBjournalctl\fR(1)
584 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
585 .RE
586 .PP
587 \fI$SYSTEMD_LOG_LOCATION\fR
588 .RS 4
589 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
590 .sp
591 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\&.
592 .RE
593 .PP
594 \fI$SYSTEMD_LOG_TID\fR
595 .RS 4
596 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
597 .sp
598 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\&.
599 .RE
600 .PP
601 \fI$SYSTEMD_LOG_TARGET\fR
602 .RS 4
603 The destination for log messages\&. One of
604 \fBconsole\fR
605 (log to the attached tty),
606 \fBconsole\-prefixed\fR
607 (log to the attached tty but with prefixes encoding the log level and "facility", see
608 \fBsyslog\fR(3),
609 \fBkmsg\fR
610 (log to the kernel circular log buffer),
611 \fBjournal\fR
612 (log to the journal),
613 \fBjournal\-or\-kmsg\fR
614 (log to the journal if available, and to kmsg otherwise),
615 \fBauto\fR
616 (determine the appropriate log target automatically, the default),
617 \fBnull\fR
618 (disable log output)\&.
619 .RE
620 .PP
621 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
622 .RS 4
623 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
624 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
625 .RE
626 .PP
627 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
628 .RS 4
629 Pager to use when
630 \fB\-\-no\-pager\fR
631 is not given\&.
632 \fI$SYSTEMD_PAGER\fR
633 is used if set; otherwise
634 \fI$PAGER\fR
635 is used\&. If neither
636 \fI$SYSTEMD_PAGER\fR
637 nor
638 \fI$PAGER\fR
639 are set, a set of well\-known pager implementations is tried in turn, including
640 \fBless\fR(1)
641 and
642 \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
643 "cat"
644 is equivalent to passing
645 \fB\-\-no\-pager\fR\&.
646 .sp
647 Note: if
648 \fI$SYSTEMD_PAGERSECURE\fR
649 is not set,
650 \fI$SYSTEMD_PAGER\fR
651 and
652 \fI$PAGER\fR
653 can only be used to disable the pager (with
654 "cat"
655 or
656 ""), and are otherwise ignored\&.
657 .RE
658 .PP
659 \fI$SYSTEMD_LESS\fR
660 .RS 4
661 Override the options passed to
662 \fBless\fR
663 (by default
664 "FRSXMK")\&.
665 .sp
666 Users might want to change two options in particular:
667 .PP
668 \fBK\fR
669 .RS 4
670 This option instructs the pager to exit immediately when
671 Ctrl+C
672 is pressed\&. To allow
673 \fBless\fR
674 to handle
675 Ctrl+C
676 itself to switch back to the pager command prompt, unset this option\&.
677 .sp
678 If the value of
679 \fI$SYSTEMD_LESS\fR
680 does not include
681 "K", and the pager that is invoked is
682 \fBless\fR,
683 Ctrl+C
684 will be ignored by the executable, and needs to be handled by the pager\&.
685 .RE
686 .PP
687 \fBX\fR
688 .RS 4
689 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\&.
690 .RE
691 .sp
692 Note that setting the regular
693 \fI$LESS\fR
694 environment variable has no effect for
695 \fBless\fR
696 invocations by systemd tools\&.
697 .sp
698 See
699 \fBless\fR(1)
700 for more discussion\&.
701 .RE
702 .PP
703 \fI$SYSTEMD_LESSCHARSET\fR
704 .RS 4
705 Override the charset passed to
706 \fBless\fR
707 (by default
708 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
709 .sp
710 Note that setting the regular
711 \fI$LESSCHARSET\fR
712 environment variable has no effect for
713 \fBless\fR
714 invocations by systemd tools\&.
715 .RE
716 .PP
717 \fI$SYSTEMD_PAGERSECURE\fR
718 .RS 4
719 Common pager commands like
720 \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
721 \fBsudo\fR(8)
722 or
723 \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,
724 \fIif the pager supports that\fR
725 (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
726 \fB\-\-no\-pager\fR
727 or
728 \fIPAGER=cat\fR
729 when allowing untrusted users to execute commands with elevated privileges\&.
730 .sp
731 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
732 \fBLESSSECURE=1\fR
733 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
734 \fBless\fR(1)
735 is known to understand this variable and implement "secure mode"\&.
736 .sp
737 When set to false, no limitation is placed on the pager\&. Setting
738 \fISYSTEMD_PAGERSECURE=0\fR
739 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
740 .sp
741 When
742 \fI$SYSTEMD_PAGERSECURE\fR
743 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
744 \fBgeteuid\fR(2)
745 and
746 \fBsd_pid_get_owner_uid\fR(3), or when running under
747 \fBsudo\fR(8)
748 or similar tools (\fI$SUDO_UID\fR
749 is set
750 \&\s-2\u[2]\d\s+2)\&. In those cases,
751 \fISYSTEMD_PAGERSECURE=1\fR
752 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
753 \fI$SYSTEMD_PAGERSECURE\fR
754 or disable the pager\&.
755 .sp
756 Note that if the
757 \fI$SYSTEMD_PAGER\fR
758 or
759 \fI$PAGER\fR
760 variables are to be honoured, other than to disable the pager,
761 \fI$SYSTEMD_PAGERSECURE\fR
762 must be set too\&.
763 .RE
764 .PP
765 \fI$SYSTEMD_COLORS\fR
766 .RS 4
767 Takes a boolean argument\&. When true,
768 \fBsystemd\fR
769 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:
770 "16",
771 "256"
772 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
773 \fI$TERM\fR
774 and what the console is connected to\&.
775 .RE
776 .PP
777 \fI$SYSTEMD_URLIFY\fR
778 .RS 4
779 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
780 \fBsystemd\fR
781 makes based on
782 \fI$TERM\fR
783 and other conditions\&.
784 .RE
785 .SH "SEE ALSO"
786 .PP
787 \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), \fBbzip2\fR(1)
788 .SH "NOTES"
789 .IP " 1." 4
790 HTTP ETag
791 .RS 4
792 \%https://en.wikipedia.org/wiki/HTTP_ETag
793 .RE
794 .IP " 2." 4
795 It is recommended for other tools to set and check
796 \fI$SUDO_UID\fR
797 as appropriate, treating it is a common interface.
798