Debian Codegraph @

upstream/debian-unstable/man1/portablectl.1

raw
1 '\" t
2 .TH "PORTABLECTL" "1" "" "systemd 261~rc3" "portablectl"
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 portablectl \- Attach, detach or inspect portable service images
24 .SH "SYNOPSIS"
25 .HP \w'\fBportablectl\fR\ 'u
26 \fBportablectl\fR [OPTIONS...] {COMMAND} [NAME...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBportablectl\fR
30 may be used to attach, detach or inspect portable service images\&. It\*(Aqs primarily a command interfacing with
31 \fBsystemd-portabled.service\fR(8)\&.
32 .PP
33 Portable service images contain an OS file system tree along with
34 \fBsystemd\fR(1)
35 unit file information\&. A service image may be "attached" to the local system\&. If attached, a set of unit files are copied from the image to the host, and extended with
36 \fIRootDirectory=\fR
37 or
38 \fIRootImage=\fR
39 assignments (in case of service units) pointing to the image file or directory, ensuring the services will run within the file system context of the image\&.
40 .PP
41 Portable service images are an efficient way to bundle multiple related services and other units together, and transfer them as a whole between systems\&. When these images are attached to the local system, the contained units may run in most ways like regular system\-provided units, either with full privileges or inside strict sandboxing, depending on the selected configuration\&. For more details, see
42 \m[blue]\fBPortable Services\fR\m[]\&\s-2\u[1]\d\s+2\&.
43 .PP
44 Portable service images may be of the following kinds:
45 .sp
46 .RS 4
47 .ie n \{\
48 \h'-04'\(bu\h'+03'\c
49 .\}
50 .el \{\
51 .sp -1
52 .IP \(bu 2.3
53 .\}
54 Directory trees containing an OS, including the top\-level directories
55 /usr/,
56 /etc/, and so on\&.
57 .RE
58 .sp
59 .RS 4
60 .ie n \{\
61 \h'-04'\(bu\h'+03'\c
62 .\}
63 .el \{\
64 .sp -1
65 .IP \(bu 2.3
66 .\}
67 btrfs subvolumes containing OS trees, similar to normal directory trees\&.
68 .RE
69 .sp
70 .RS 4
71 .ie n \{\
72 \h'-04'\(bu\h'+03'\c
73 .\}
74 .el \{\
75 .sp -1
76 .IP \(bu 2.3
77 .\}
78 Binary "raw" disk images containing MBR or GPT partition tables and Linux file system partitions\&. (These must be regular files, with the
79 \&.raw
80 suffix\&.)
81 .RE
82 .SH "COMMANDS"
83 .PP
84 The following commands are understood:
85 .PP
86 \fBlist\fR
87 .RS 4
88 List available portable service images\&. This will list all portable service images discovered in the portable image search paths (see below), along with brief metadata and state information\&. Note that many of the commands below may both operate on images inside and outside of the search paths\&. This command is hence mostly a convenience option, the commands are generally not restricted to what this list shows\&.
89 .sp
90 Added in version 239\&.
91 .RE
92 .PP
93 \fBattach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
94 .RS 4
95 Attach a portable service image to the host system\&. Expects a file system path to a portable service image file or directory as first argument\&. If the specified path contains no slash character ("/") it is understood as image filename that is searched for in the portable service image search paths (see below)\&. To reference a file in the current working directory prefix the filename with
96 "\&./"
97 to avoid this search path logic\&.
98 .sp
99 When a portable service is attached four operations are executed:
100 .sp
101 .RS 4
102 .ie n \{\
103 \h'-04' 1.\h'+01'\c
104 .\}
105 .el \{\
106 .sp -1
107 .IP " 1." 4.2
108 .\}
109 All unit files of types
110 \&.service,
111 \&.socket,
112 \&.target,
113 \&.timer
114 and
115 \&.path
116 which match the indicated unit file name prefix are copied from the image to the host\*(Aqs
117 /etc/systemd/system\&.attached/
118 directory (or
119 /run/systemd/system\&.attached/
120 \(em depending whether
121 \fB\-\-runtime\fR
122 is specified, see below), which is included in the built\-in unit search path of the system service manager\&.
123 .RE
124 .sp
125 .RS 4
126 .ie n \{\
127 \h'-04' 2.\h'+01'\c
128 .\}
129 .el \{\
130 .sp -1
131 .IP " 2." 4.2
132 .\}
133 For unit files of type
134 \&.service
135 a drop\-in is added to these copies that adds
136 \fIRootDirectory=\fR
137 or
138 \fIRootImage=\fR
139 settings (see
140 \fBsystemd.unit\fR(5)
141 for details), that ensures these services are run within the file system of the originating portable service image\&.
142 .RE
143 .sp
144 .RS 4
145 .ie n \{\
146 \h'-04' 3.\h'+01'\c
147 .\}
148 .el \{\
149 .sp -1
150 .IP " 3." 4.2
151 .\}
152 A second drop\-in is created: the "profile" drop\-in, that may contain additional security settings (and other settings)\&. A number of profiles are available by default but administrators may define their own ones\&. See below\&.
153 .RE
154 .sp
155 .RS 4
156 .ie n \{\
157 \h'-04' 4.\h'+01'\c
158 .\}
159 .el \{\
160 .sp -1
161 .IP " 4." 4.2
162 .\}
163 If the portable service image file is not already in the search path (see below), a symbolic link to it is created in
164 /etc/portables/
165 or
166 /run/portables/, to make sure it is included in it\&.
167 .RE
168 .sp
169 By default, all unit files whose names start with a prefix generated from the image\*(Aqs file name are copied out\&. Specifically, the prefix is determined from the image file name with any suffix such as
170 \&.raw
171 removed, truncated at the first occurrence of an underscore character ("_"), if there is one\&. The underscore logic is supposed to be used to versioning so that the an image file
172 foobar_47\&.11\&.raw
173 will result in a unit file matching prefix of
174 foobar\&. This prefix is then compared with all unit files names contained in the image in the usual directories, but only unit file names where the prefix is followed by
175 "\-",
176 "\&."
177 or
178 "@"
179 are considered\&. Example: if a portable service image file is named
180 foobar_47\&.11\&.raw
181 then by default all its unit files with names such as
182 foobar\-quux\-waldi\&.service,
183 foobar\&.service
184 or
185 foobar@\&.service
186 will be considered\&. It\*(Aqs possible to override the matching prefix: all strings listed on the command line after the image file name are considered prefixes, overriding the implicit logic where the prefix is derived from the image file name\&.
187 .sp
188 By default, after the unit files are attached the service manager\*(Aqs configuration is reloaded, except when
189 \fB\-\-no\-reload\fR
190 is specified (see below)\&. This ensures that the new units made available to the service manager are seen by it\&.
191 .sp
192 If
193 \fB\-\-now\fR
194 and/or
195 \fB\-\-enable\fR
196 are passed, the portable services are immediately started (blocking operation unless
197 \fB\-\-no\-block\fR
198 is passed) and/or enabled after attaching the image\&.
199 .sp
200 When images are attached, an image policy will be generated that pins the attached image by the exact content that was found while attaching, so that it cannot be swapped downgrading security (e\&.g\&.: removing dm\-verity protection) without a full reinstallation\&. For more details on policies, see
201 \fBsystemd.image-policy\fR(7)\&.
202 .sp
203 In place of the image path a
204 "\&.v/"
205 versioned directory may be specified, see
206 \fBsystemd.v\fR(7)
207 for details\&.
208 .sp
209 In place of the directory path a
210 "\&.v/"
211 versioned directory may be specified, see
212 \fBsystemd.v\fR(7)
213 for details\&.
214 .sp
215 Added in version 239\&.
216 .RE
217 .PP
218 \fBdetach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
219 .RS 4
220 Detaches a portable service image from the host\&. This undoes the operations executed by the
221 \fBattach\fR
222 command above, and removes the unit file copies, drop\-ins and image symlink again\&. This command expects an image name or path as parameter\&. Note that if a path is specified only the last component of it (i\&.e\&. the file or directory name itself, not the path to it) is used for finding matching unit files\&. This is a convenience feature to allow all arguments passed as
223 \fBattach\fR
224 also to
225 \fBdetach\fR\&.
226 .sp
227 If
228 \fB\-\-now\fR
229 and/or
230 \fB\-\-enable\fR
231 are passed, the portable services are immediately stopped (blocking operation) and/or disabled before detaching the image\&. Prefix(es) are also accepted, to be used in case the unit names do not match the image name as described in the
232 \fBattach\fR\&.
233 .sp
234 Added in version 239\&.
235 .RE
236 .PP
237 \fBreattach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
238 .RS 4
239 Detaches an existing portable service image from the host, and immediately attaches it again\&. This is useful in case the image was replaced\&. Running units are not stopped during the process\&. Partial matching, to allow for different versions in the image name, is allowed: only the part before the first
240 "_"
241 character has to match\&. If the new image does not exist, the existing one will not be detached\&. The parameters follow the same syntax as the
242 \fBattach\fR
243 command\&.
244 .sp
245 If
246 \fB\-\-now\fR
247 and/or
248 \fB\-\-enable\fR
249 are passed, the portable services are immediately stopped if removed, started and/or enabled if added, or restarted if updated\&. Prefixes are also accepted, in the same way as described in the
250 \fBattach\fR
251 case\&.
252 .sp
253 Added in version 248\&.
254 .RE
255 .PP
256 \fBinspect\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
257 .RS 4
258 Extracts various metadata from a portable service image and presents it to the caller\&. Specifically, the
259 \fBos-release\fR(5)
260 file of the image is retrieved as well as all matching unit files\&. By default, a short summary showing the most relevant metadata in combination with a list of matching unit files is shown (that is the unit files
261 \fBattach\fR
262 would install to the host system)\&. If combined with
263 \fB\-\-cat\fR
264 (see above), the
265 os\-release
266 data and the units files\*(Aq contents is displayed unprocessed\&. This command is useful to determine whether an image qualifies as portable service image, and which unit files are included\&. This command expects the path to the image as parameter, optionally followed by a list of unit file prefixes to consider, similar to the
267 \fBattach\fR
268 command described above\&.
269 .sp
270 Added in version 239\&.
271 .RE
272 .PP
273 \fBis\-attached\fR \fIIMAGE\fR
274 .RS 4
275 Determines whether the specified image is currently attached or not\&. Unless combined with the
276 \fB\-\-quiet\fR
277 switch this will show a short state identifier for the image\&. Specifically:
278 .sp
279 .it 1 an-trap
280 .nr an-no-space-flag 1
281 .nr an-break-flag 1
282 .br
283 .B Table\ \&1.\ \&Image attachment states
284 .TS
285 allbox tab(:);
286 lB lB.
287 T{
288 State
289 T}:T{
290 Description
291 T}
292 .T&
293 l l
294 l l
295 l l
296 l l
297 l l
298 l l
299 l l.
300 T{
301 \fBdetached\fR
302 T}:T{
303 The image is currently not attached\&.
304 T}
305 T{
306 \fBattached\fR
307 T}:T{
308 The image is currently attached, i\&.e\&. its unit files have been made available to the host system\&.
309 T}
310 T{
311 \fBattached\-runtime\fR
312 T}:T{
313 Like \fBattached\fR, but the unit files have been made available transiently only, i\&.e\&. the \fBattach\fR command has been invoked with the \fB\-\-runtime\fR option\&.
314 T}
315 T{
316 \fBenabled\fR
317 T}:T{
318 The image is currently attached, and at least one unit file associated with it has been enabled\&.
319 T}
320 T{
321 \fBenabled\-runtime\fR
322 T}:T{
323 Like \fBenabled\fR, but the unit files have been made available transiently only, i\&.e\&. the \fBattach\fR command has been invoked with the \fB\-\-runtime\fR option\&.
324 T}
325 T{
326 \fBrunning\fR
327 T}:T{
328 The image is currently attached, and at least one unit file associated with it is running\&.
329 T}
330 T{
331 \fBrunning\-runtime\fR
332 T}:T{
333 The image is currently attached transiently, and at least one unit file associated with it is running\&.
334 T}
335 .TE
336 .sp 1
337 Added in version 239\&.
338 .RE
339 .PP
340 \fBread\-only\fR \fIIMAGE\fR [\fIBOOL\fR]
341 .RS 4
342 Marks or (unmarks) a portable service image read\-only\&. Takes an image name, followed by a boolean as arguments\&. If the boolean is omitted, positive is implied, i\&.e\&. the image is marked read\-only\&.
343 .sp
344 Added in version 239\&.
345 .RE
346 .PP
347 \fBremove\fR \fIIMAGE\fR\&...
348 .RS 4
349 Removes one or more portable service images\&. Note that this command will only remove the specified image path itself \(em it refers to a symbolic link then the symbolic link is removed and not the image it points to\&.
350 .sp
351 Added in version 239\&.
352 .RE
353 .PP
354 \fBset\-limit\fR [\fIIMAGE\fR] \fIBYTES\fR
355 .RS 4
356 Sets the maximum size in bytes that a specific portable service image, or all images, may grow up to on disk (disk quota)\&. Takes either one or two parameters\&. The first, optional parameter refers to a portable service image name\&. If specified, the size limit of the specified image is changed\&. If omitted, the overall size limit of the sum of all images stored locally is changed\&. The final argument specifies the size limit in bytes, possibly suffixed by the usual K, M, G, T units\&. If the size limit shall be disabled, specify
357 "\-"
358 as size\&.
359 .sp
360 Note that per\-image size limits are only supported on btrfs file systems\&. Also, depending on
361 \fIBindPaths=\fR
362 settings in the portable service\*(Aqs unit files directories from the host might be visible in the image environment during runtime which are not affected by this setting, as only the image itself is counted against this limit\&.
363 .sp
364 Added in version 239\&.
365 .RE
366 .SH "OPTIONS"
367 .PP
368 The following options are understood:
369 .PP
370 \fB\-q\fR, \fB\-\-quiet\fR
371 .RS 4
372 Suppresses additional informational output while running\&.
373 .sp
374 Added in version 239\&.
375 .RE
376 .PP
377 \fB\-p\fR \fIPROFILE\fR, \fB\-\-profile=\fR\fB\fIPROFILE\fR\fR
378 .RS 4
379 When attaching an image, select the profile to use\&. By default, the
380 "default"
381 profile is used\&. For details about profiles, see below\&.
382 .sp
383 Added in version 239\&.
384 .RE
385 .PP
386 \fB\-\-copy=\fR
387 .RS 4
388 When attaching an image, select whether to prefer copying or symlinking of files installed into the host system\&. Takes one of
389 "copy"
390 (files will be copied),
391 "symlink"
392 (to prefer creation of symbolic links),
393 "auto"
394 for an intermediary mode where security profile drop\-ins and images are symlinked while unit files are copied, or
395 "mixed"
396 (since v256) where security profile drop\-ins are symlinked while unit files and images are copied\&. Note that this option expresses a preference only, in cases where symbolic links cannot be created \(em for example when the image operated on is a raw disk image, and hence not directly referentiable from the host file system \(em copying of files is used unconditionally\&.
397 .sp
398 Added in version 239\&.
399 .RE
400 .PP
401 \fB\-\-runtime\fR
402 .RS 4
403 When specified the unit and drop\-in files are placed in
404 /run/systemd/system\&.attached/
405 instead of
406 /etc/systemd/system\&.attached/\&. Images attached with this option set hence remain attached only until the next reboot, while they are normally attached persistently\&.
407 .sp
408 Added in version 239\&.
409 .RE
410 .PP
411 \fB\-\-no\-reload\fR
412 .RS 4
413 Do not reload the service manager after attaching or detaching a portable service image\&. Normally the service manager is reloaded to ensure it is aware of added or removed unit files\&.
414 .sp
415 Added in version 239\&.
416 .RE
417 .PP
418 \fB\-\-cat\fR
419 .RS 4
420 When inspecting portable service images, show the (unprocessed) contents of the metadata files pulled from the image, instead of brief summaries\&. Specifically, this will show the
421 \fBos-release\fR(5)
422 and unit file contents of the image\&.
423 .sp
424 Added in version 239\&.
425 .RE
426 .PP
427 \fB\-\-enable\fR
428 .RS 4
429 Immediately enable/disable the portable service after attaching/detaching\&.
430 .sp
431 Added in version 245\&.
432 .RE
433 .PP
434 \fB\-\-now\fR
435 .RS 4
436 Immediately start/stop/restart the portable service after attaching/before detaching/after upgrading\&.
437 .sp
438 Added in version 245\&.
439 .RE
440 .PP
441 \fB\-\-no\-block\fR
442 .RS 4
443 Do not block waiting for attach \-\-now to complete\&.
444 .sp
445 Added in version 245\&.
446 .RE
447 .PP
448 \fB\-\-clean\fR
449 .RS 4
450 When detaching ensure the configuration, state, logs, cache, and runtime data directories of the portable service are removed from the host system\&.
451 .sp
452 Added in version 256\&.
453 .RE
454 .PP
455 \fB\-\-extension=\fR\fB\fIPATH\fR\fR
456 .RS 4
457 Add an additional image
458 \fIPATH\fR
459 as an overlay on top of
460 \fIIMAGE\fR
461 when attaching/detaching\&. This argument can be specified multiple times, in which case the order in which images are laid down follows the rules specified in
462 \fBsystemd.exec\fR(5)
463 for the
464 \fIExtensionImages=\fR
465 directive and for the
466 \fBsystemd-sysext\fR(8)
467 and
468 \fBsystemd-confext\fR(8)
469 tools\&. The images must contain an
470 extension\-release
471 file with metadata that matches what is defined in the
472 os\-release
473 of
474 \fIIMAGE\fR\&. See:
475 \fBos-release\fR(5)\&. Images can be block images, btrfs subvolumes or directories\&. For more information on portable services with extensions, see the
476 "Extension Images"
477 paragraph on
478 \m[blue]\fBPortable Services\fR\m[]\&\s-2\u[1]\d\s+2\&.
479 .sp
480 Note that the same extensions have to be specified, in the same order, when attaching and detaching\&.
481 .sp
482 In place of the image path a
483 "\&.v/"
484 versioned directory may be specified, see
485 \fBsystemd.v\fR(7)
486 for details\&.
487 .sp
488 In place of the directory path a
489 "\&.v/"
490 versioned directory may be specified, see
491 \fBsystemd.v\fR(7)
492 for details\&.
493 .sp
494 Added in version 249\&.
495 .RE
496 .PP
497 \fB\-\-force\fR
498 .RS 4
499 Skip safety checks and attach or detach images (with extensions) without first ensuring that the units are not running, and do not insist that the
500 extension\-release\&.\fINAME\fR
501 file in the extension image has to match the image filename\&.
502 .sp
503 Added in version 252\&.
504 .RE
505 .PP
506 \fB\-H\fR, \fB\-\-host=\fR
507 .RS 4
508 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
509 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
510 ":", and then a container name, separated by
511 "/", 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
512 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
513 .RE
514 .PP
515 \fB\-M\fR, \fB\-\-machine=\fR
516 .RS 4
517 Execute operation on a local container\&. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating
518 "@"
519 character\&. If the special string
520 "\&.host"
521 is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user\*(Aqs user bus:
522 "\-\-user \-\-machine=lennart@\&.host")\&. If the
523 "@"
524 syntax is not used, the connection is made as root user\&. If the
525 "@"
526 syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and
527 "\&.host"
528 are implied\&.
529 .RE
530 .PP
531 \fB\-\-no\-pager\fR
532 .RS 4
533 Do not pipe output into a pager\&.
534 .RE
535 .PP
536 \fB\-\-no\-legend\fR
537 .RS 4
538 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
539 .RE
540 .PP
541 \fB\-\-no\-ask\-password\fR
542 .RS 4
543 Do not query the user for authentication for privileged operations\&.
544 .RE
545 .PP
546 \fB\-h\fR, \fB\-\-help\fR
547 .RS 4
548 Print a short help text and exit\&.
549 .RE
550 .PP
551 \fB\-\-version\fR
552 .RS 4
553 Print a short version string and exit\&.
554 .RE
555 .SH "FILES AND DIRECTORIES"
556 .PP
557 Portable service images are preferably stored in
558 /var/lib/portables/, but are also searched for in
559 /etc/portables/,
560 /run/portables/,
561 /usr/local/lib/portables/
562 and
563 /usr/lib/portables/\&. It\*(Aqs recommended not to place image files directly in
564 /etc/portables/
565 or
566 /run/portables/
567 (as these are generally not suitable for storing large or non\-textual data), but use these directories only for linking images located elsewhere into the image search path\&.
568 .PP
569 When a portable service image is attached, matching unit files are copied onto the host into the
570 /etc/systemd/system\&.attached/
571 and
572 /run/systemd/system\&.attached/
573 directories\&. When an image is detached, the unit files are removed again from these directories\&.
574 .SH "PROFILES"
575 .PP
576 When portable service images are attached a "profile" drop\-in is linked in, which may be used to enforce additional security (and other) restrictions locally\&. Four profile drop\-ins are defined by default, and shipped in
577 /usr/lib/systemd/portable/profile/\&. Additional, local profiles may be defined by placing them in
578 /etc/systemd/portable/profile/\&. The default profiles are:
579 .sp
580 .it 1 an-trap
581 .nr an-no-space-flag 1
582 .nr an-break-flag 1
583 .br
584 .B Table\ \&2.\ \&Profiles
585 .TS
586 allbox tab(:);
587 lB lB.
588 T{
589 Name
590 T}:T{
591 Description
592 T}
593 .T&
594 l l
595 l l
596 l l
597 l l.
598 T{
599 default
600 T}:T{
601 This is the default profile if no other profile name is set via the \fB\-\-profile=\fR (see above)\&. It\*(Aqs fairly restrictive, but should be useful for common, unprivileged system workloads\&. This includes write access to the logging framework, as well as IPC access to the D\-Bus system\&.
602 T}
603 T{
604 nonetwork
605 T}:T{
606 Very similar to default, but networking is turned off for any services of the portable service image\&.
607 T}
608 T{
609 strict
610 T}:T{
611 A profile with very strict settings\&. This profile excludes IPC (D\-Bus) and network access\&.
612 T}
613 T{
614 trusted
615 T}:T{
616 A profile with very relaxed settings\&. In this profile the services run with full privileges\&.
617 T}
618 .TE
619 .sp 1
620 .PP
621 For details on these profiles and their effects see their precise definitions, e\&.g\&.
622 /usr/lib/systemd/portable/profile/default/service\&.conf
623 and similar\&.
624 .SH "EXIT STATUS"
625 .PP
626 On success, 0 is returned, a non\-zero failure code otherwise\&.
627 .SH "ENVIRONMENT"
628 .PP
629 \fI$SYSTEMD_LOG_LEVEL\fR
630 .RS 4
631 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)
632 \fBemerg\fR,
633 \fBalert\fR,
634 \fBcrit\fR,
635 \fBerr\fR,
636 \fBwarning\fR,
637 \fBnotice\fR,
638 \fBinfo\fR,
639 \fBdebug\fR, or an integer in the range 0\&...7\&. See
640 \fBsyslog\fR(3)
641 for more information\&. Each value may optionally be prefixed with one of
642 \fBconsole\fR,
643 \fBsyslog\fR,
644 \fBkmsg\fR
645 or
646 \fBjournal\fR
647 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
648 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
649 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\&.
650 .RE
651 .PP
652 \fI$SYSTEMD_LOG_COLOR\fR
653 .RS 4
654 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
655 .sp
656 This setting is only useful when messages are written directly to the terminal, because
657 \fBjournalctl\fR(1)
658 and other tools that display logs will color messages based on the log level on their own\&.
659 .RE
660 .PP
661 \fI$SYSTEMD_LOG_TIME\fR
662 .RS 4
663 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
664 .sp
665 This setting is only useful when messages are written directly to the terminal or a file, because
666 \fBjournalctl\fR(1)
667 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
668 .RE
669 .PP
670 \fI$SYSTEMD_LOG_LOCATION\fR
671 .RS 4
672 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
673 .sp
674 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\&.
675 .RE
676 .PP
677 \fI$SYSTEMD_LOG_TID\fR
678 .RS 4
679 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
680 .sp
681 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\&.
682 .RE
683 .PP
684 \fI$SYSTEMD_LOG_TARGET\fR
685 .RS 4
686 The destination for log messages\&. One of
687 \fBconsole\fR
688 (log to the attached tty),
689 \fBconsole\-prefixed\fR
690 (log to the attached tty but with prefixes encoding the log level and "facility", see
691 \fBsyslog\fR(3),
692 \fBkmsg\fR
693 (log to the kernel circular log buffer),
694 \fBjournal\fR
695 (log to the journal),
696 \fBjournal\-or\-kmsg\fR
697 (log to the journal if available, and to kmsg otherwise),
698 \fBauto\fR
699 (determine the appropriate log target automatically, the default),
700 \fBnull\fR
701 (disable log output)\&.
702 .RE
703 .PP
704 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
705 .RS 4
706 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
707 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
708 .RE
709 .PP
710 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
711 .RS 4
712 Pager to use when
713 \fB\-\-no\-pager\fR
714 is not given\&.
715 \fI$SYSTEMD_PAGER\fR
716 is used if set; otherwise
717 \fI$PAGER\fR
718 is used\&. If neither
719 \fI$SYSTEMD_PAGER\fR
720 nor
721 \fI$PAGER\fR
722 are set, a set of well\-known pager implementations is tried in turn, including
723 \fBless\fR(1)
724 and
725 \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
726 "cat"
727 is equivalent to passing
728 \fB\-\-no\-pager\fR\&.
729 .sp
730 Note: if
731 \fI$SYSTEMD_PAGERSECURE\fR
732 is not set,
733 \fI$SYSTEMD_PAGER\fR
734 and
735 \fI$PAGER\fR
736 can only be used to disable the pager (with
737 "cat"
738 or
739 ""), and are otherwise ignored\&.
740 .RE
741 .PP
742 \fI$SYSTEMD_LESS\fR
743 .RS 4
744 Override the options passed to
745 \fBless\fR
746 (by default
747 "FRSXMK")\&.
748 .sp
749 Users might want to change two options in particular:
750 .PP
751 \fBK\fR
752 .RS 4
753 This option instructs the pager to exit immediately when
754 Ctrl+C
755 is pressed\&. To allow
756 \fBless\fR
757 to handle
758 Ctrl+C
759 itself to switch back to the pager command prompt, unset this option\&.
760 .sp
761 If the value of
762 \fI$SYSTEMD_LESS\fR
763 does not include
764 "K", and the pager that is invoked is
765 \fBless\fR,
766 Ctrl+C
767 will be ignored by the executable, and needs to be handled by the pager\&.
768 .RE
769 .PP
770 \fBX\fR
771 .RS 4
772 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\&.
773 .RE
774 .sp
775 Note that setting the regular
776 \fI$LESS\fR
777 environment variable has no effect for
778 \fBless\fR
779 invocations by systemd tools\&.
780 .sp
781 See
782 \fBless\fR(1)
783 for more discussion\&.
784 .RE
785 .PP
786 \fI$SYSTEMD_LESSCHARSET\fR
787 .RS 4
788 Override the charset passed to
789 \fBless\fR
790 (by default
791 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
792 .sp
793 Note that setting the regular
794 \fI$LESSCHARSET\fR
795 environment variable has no effect for
796 \fBless\fR
797 invocations by systemd tools\&.
798 .RE
799 .PP
800 \fI$SYSTEMD_PAGERSECURE\fR
801 .RS 4
802 Common pager commands like
803 \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
804 \fBsudo\fR(8)
805 or
806 \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,
807 \fIif the pager supports that\fR
808 (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
809 \fB\-\-no\-pager\fR
810 or
811 \fIPAGER=cat\fR
812 when allowing untrusted users to execute commands with elevated privileges\&.
813 .sp
814 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
815 \fBLESSSECURE=1\fR
816 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
817 \fBless\fR(1)
818 is known to understand this variable and implement "secure mode"\&.
819 .sp
820 When set to false, no limitation is placed on the pager\&. Setting
821 \fISYSTEMD_PAGERSECURE=0\fR
822 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
823 .sp
824 When
825 \fI$SYSTEMD_PAGERSECURE\fR
826 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
827 \fBgeteuid\fR(2)
828 and
829 \fBsd_pid_get_owner_uid\fR(3), or when running under
830 \fBsudo\fR(8)
831 or similar tools (\fI$SUDO_UID\fR
832 is set
833 \&\s-2\u[2]\d\s+2)\&. In those cases,
834 \fISYSTEMD_PAGERSECURE=1\fR
835 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
836 \fI$SYSTEMD_PAGERSECURE\fR
837 or disable the pager\&.
838 .sp
839 Note that if the
840 \fI$SYSTEMD_PAGER\fR
841 or
842 \fI$PAGER\fR
843 variables are to be honoured, other than to disable the pager,
844 \fI$SYSTEMD_PAGERSECURE\fR
845 must be set too\&.
846 .RE
847 .PP
848 \fI$SYSTEMD_COLORS\fR
849 .RS 4
850 Takes a boolean argument, or a special value\&. By default (unset),
851 \fBsystemd\fR
852 and related utilities will use colors in their output if possible\&. If
853 \fI$COLORTERM\fR
854 is set to
855 "truecolor"
856 or
857 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
858 \fI$NO_COLOR\fR
859 or
860 \fI$TERM\fR
861 indicates colors are disabled\&.
862 .PP
863 \fBtrue\fR
864 .RS 4
865 Same as unset, except that
866 \fI$NO_COLOR\fR
867 is ignored\&.
868 .RE
869 .PP
870 \fBfalse\fR
871 .RS 4
872 The output will be monochrome\&.
873 .RE
874 .PP
875 "16", "256", "24bit"
876 .RS 4
877 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
878 .RE
879 .PP
880 "auto\-16", "auto\-256", "auto\-24bit"
881 .RS 4
882 Use the given quantity of colours, subject to
883 \fI$TERM\fR, and what the console is connected to\&.
884 .RE
885 .RE
886 .PP
887 \fI$SYSTEMD_URLIFY\fR
888 .RS 4
889 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
890 \fBsystemd\fR
891 makes based on
892 \fI$TERM\fR
893 and other conditions\&.
894 .RE
895 .SH "SEE ALSO"
896 .PP
897 \fBsystemd\fR(1), \fBsystemd-sysext\fR(8), \fBorg.freedesktop.portable1\fR(5), \fBsystemd-portabled.service\fR(8), \fBimportctl\fR(1)
898 .SH "NOTES"
899 .IP " 1." 4
900 Portable Services
901 .RS 4
902 \%https://systemd.io/PORTABLE_SERVICES
903 .RE
904 .IP " 2." 4
905 It is recommended for other tools to set and check
906 \fI$SUDO_UID\fR
907 as appropriate, treating it is a common interface.
908