Debian Codegraph @

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