summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man1/portablectl.1
blob: 4dba78bb60fde0e54f9f7f9aed65fe828567a343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
'\" t
.TH "PORTABLECTL" "1" "" "systemd 255" "portablectl"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
portablectl \- Attach, detach or inspect portable service images
.SH "SYNOPSIS"
.HP \w'\fBportablectl\fR\ 'u
\fBportablectl\fR [OPTIONS...] {COMMAND} [NAME...]
.SH "DESCRIPTION"
.PP
\fBportablectl\fR
may be used to attach, detach or inspect portable service images\&. It\*(Aqs primarily a command interfacing with
\fBsystemd-portabled.service\fR(8)\&.
.PP
Portable service images contain an OS file system tree along with
\fBsystemd\fR(1)
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
\fIRootDirectory=\fR
or
\fIRootImage=\fR
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\&.
.PP
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 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
\m[blue]\fBPortable Services Documentation\fR\m[]\&\s-2\u[1]\d\s+2\&.
.PP
Specifically portable service images may be of the following kind:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Directory trees containing an OS, including the top\-level directories
/usr/,
/etc/, and so on\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
btrfs subvolumes containing OS trees, similar to normal directory trees\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Binary "raw" disk images containing MBR or GPT partition tables and Linux file system partitions\&. (These must be regular files, with the
\&.raw
suffix\&.)
.RE
.SH "COMMANDS"
.PP
The following commands are understood:
.PP
\fBlist\fR
.RS 4
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\&.
.sp
Added in version 239\&.
.RE
.PP
\fBattach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
.RS 4
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
"\&./"
to avoid this search path logic\&.
.sp
When a portable service is attached four operations are executed:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
All unit files of types
\&.service,
\&.socket,
\&.target,
\&.timer
and
\&.path
which match the indicated unit file name prefix are copied from the image to the host\*(Aqs
/etc/systemd/system\&.attached/
directory (or
/run/systemd/system\&.attached/
\(em depending whether
\fB\-\-runtime\fR
is specified, see below), which is included in the built\-in unit search path of the system service manager\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
For unit files of type
\&.service
a drop\-in is added to these copies that adds
\fIRootDirectory=\fR
or
\fIRootImage=\fR
settings (see
\fBsystemd.unit\fR(5)
for details), that ensures these services are run within the file system of the originating portable service image\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
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\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  4." 4.2
.\}
If the portable service image file is not already in the search path (see below), a symbolic link to it is created in
/etc/portables/
or
/run/portables/, to make sure it is included in it\&.
.RE
.sp
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
\&.raw
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
foobar_47\&.11\&.raw
will result in a unit file matching prefix of
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
"\-",
"\&."
or
"@"
are considered\&. Example: if a portable service image file is named
foobar_47\&.11\&.raw
then by default all its unit files with names such as
foobar\-quux\-waldi\&.service,
foobar\&.service
or
foobar@\&.service
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\&.
.sp
By default, after the unit files are attached the service manager\*(Aqs configuration is reloaded, except when
\fB\-\-no\-reload\fR
is specified (see below)\&. This ensures that the new units made available to the service manager are seen by it\&.
.sp
If
\fB\-\-now\fR
and/or
\fB\-\-enable\fR
are passed, the portable services are immediately started (blocking operation unless
\fB\-\-no\-block\fR
is passed) and/or enabled after attaching the image\&.
.sp
Added in version 239\&.
.RE
.PP
\fBdetach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
.RS 4
Detaches a portable service image from the host\&. This undoes the operations executed by the
\fBattach\fR
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
\fBattach\fR
also to
\fBdetach\fR\&.
.sp
Added in version 239\&.
.PP
If
\fB\-\-now\fR
and/or
\fB\-\-enable\fR
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
\fBattach\fR\&.
.RE
.PP
\fBreattach\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
.RS 4
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
"_"
character has to match\&. If the new image doesn\*(Aqt exist, the existing one will not be detached\&. The parameters follow the same syntax as the
\fBattach\fR
command\&.
.sp
Added in version 248\&.
.PP
If
\fB\-\-now\fR
and/or
\fB\-\-enable\fR
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
\fBattach\fR
case\&.
.RE
.PP
\fBinspect\fR \fIIMAGE\fR [\fIPREFIX\&...\fR]
.RS 4
Extracts various metadata from a portable service image and presents it to the caller\&. Specifically, the
\fBos-release\fR(5)
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
\fBattach\fR
would install to the host system)\&. If combined with
\fB\-\-cat\fR
(see above), the
os\-release
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
\fBattach\fR
command described above\&.
.sp
Added in version 239\&.
.RE
.PP
\fBis\-attached\fR \fIIMAGE\fR
.RS 4
Determines whether the specified image is currently attached or not\&. Unless combined with the
\fB\-\-quiet\fR
switch this will show a short state identifier for the image\&. Specifically:
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&1.\ \&Image attachment states
.TS
allbox tab(:);
lB lB.
T{
State
T}:T{
Description
T}
.T&
l l
l l
l l
l l
l l
l l
l l.
T{
\fBdetached\fR
T}:T{
The image is currently not attached\&.
T}
T{
\fBattached\fR
T}:T{
The image is currently attached, i\&.e\&. its unit files have been made available to the host system\&.
T}
T{
\fBattached\-runtime\fR
T}:T{
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\&.
T}
T{
\fBenabled\fR
T}:T{
The image is currently attached, and at least one unit file associated with it has been enabled\&.
T}
T{
\fBenabled\-runtime\fR
T}:T{
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\&.
T}
T{
\fBrunning\fR
T}:T{
The image is currently attached, and at least one unit file associated with it is running\&.
T}
T{
\fBrunning\-runtime\fR
T}:T{
The image is currently attached transiently, and at least one unit file associated with it is running\&.
T}
.TE
.sp 1
Added in version 239\&.
.RE
.PP
\fBread\-only\fR \fIIMAGE\fR [\fIBOOL\fR]
.RS 4
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\&.
.sp
Added in version 239\&.
.RE
.PP
\fBremove\fR \fIIMAGE\fR\&...
.RS 4
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\&.
.sp
Added in version 239\&.
.RE
.PP
\fBset\-limit\fR [\fIIMAGE\fR] \fIBYTES\fR
.RS 4
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
"\-"
as size\&.
.sp
Note that per\-image size limits are only supported on btrfs file systems\&. Also, depending on
\fIBindPaths=\fR
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\&.
.sp
Added in version 239\&.
.RE
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-q\fR, \fB\-\-quiet\fR
.RS 4
Suppresses additional informational output while running\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-p\fR \fIPROFILE\fR, \fB\-\-profile=\fR\fIPROFILE\fR
.RS 4
When attaching an image, select the profile to use\&. By default the
"default"
profile is used\&. For details about profiles, see below\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-\-copy=\fR
.RS 4
When attaching an image, select whether to prefer copying or symlinking of files installed into the host system\&. Takes one of
"copy"
(to prefer copying of files),
"symlink"
(to prefer creation of symbolic links) or
"auto"
for an intermediary mode where security profile drop\-ins are symlinked while unit files 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\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-\-runtime\fR
.RS 4
When specified the unit and drop\-in files are placed in
/run/systemd/system\&.attached/
instead of
/etc/systemd/system\&.attached/\&. Images attached with this option set hence remain attached only until the next reboot, while they are normally attached persistently\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-\-no\-reload\fR
.RS 4
Don\*(Aqt 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\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-\-cat\fR
.RS 4
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
\fBos-release\fR(5)
and unit file contents of the image\&.
.sp
Added in version 239\&.
.RE
.PP
\fB\-\-enable\fR
.RS 4
Immediately enable/disable the portable service after attaching/detaching\&.
.sp
Added in version 245\&.
.RE
.PP
\fB\-\-now\fR
.RS 4
Immediately start/stop/restart the portable service after attaching/before detaching/after upgrading\&.
.sp
Added in version 245\&.
.RE
.PP
\fB\-\-no\-block\fR
.RS 4
Don\*(Aqt block waiting for attach \-\-now to complete\&.
.sp
Added in version 245\&.
.RE
.PP
\fB\-\-extension=\fR\fIPATH\fR
.RS 4
Add an additional image
\fIPATH\fR
as an overlay on top of
\fIIMAGE\fR
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
\fBsystemd.exec\fR(5)
for the
\fIExtensionImages=\fR
directive and for the
\fBsystemd-sysext\fR(8)
and\&.
\fBsystemd-confext\fR(8)
tools\&. The images must contain an
extension\-release
file with metadata that matches what is defined in the
os\-release
of
\fIIMAGE\fR\&. See:
\fBos-release\fR(5)\&. Images can be block images, btrfs subvolumes or directories\&. For more information on portable services with extensions, see the
"Extension Images"
paragraph on
\m[blue]\fBPortable Services Documentation\fR\m[]\&\s-2\u[1]\d\s+2\&.
.sp
Note that the same extensions have to be specified, in the same order, when attaching and detaching\&.
.sp
Added in version 249\&.
.RE
.PP
\fB\-\-force\fR
.RS 4
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
extension\-release\&.\fINAME\fR
file in the extension image has to match the image filename\&.
.sp
Added in version 252\&.
.RE
.PP
\fB\-H\fR, \fB\-\-host=\fR
.RS 4
Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
"@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
":", and then a container name, separated by
"/", 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
\fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
.RE
.PP
\fB\-M\fR, \fB\-\-machine=\fR
.RS 4
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
"@"
character\&. If the special string
"\&.host"
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:
"\-\-user \-\-machine=lennart@\&.host")\&. If the
"@"
syntax is not used, the connection is made as root user\&. If the
"@"
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
"\&.host"
are implied\&.
.RE
.PP
\fB\-\-no\-pager\fR
.RS 4
Do not pipe output into a pager\&.
.RE
.PP
\fB\-\-no\-legend\fR
.RS 4
Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
.RE
.PP
\fB\-\-no\-ask\-password\fR
.RS 4
Do not query the user for authentication for privileged operations\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "FILES AND DIRECTORIES"
.PP
Portable service images are preferably stored in
/var/lib/portables/, but are also searched for in
/etc/portables/,
/run/systemd/portables/,
/usr/local/lib/portables/
and
/usr/lib/portables/\&. It\*(Aqs recommended not to place image files directly in
/etc/portables/
or
/run/systemd/portables/
(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\&.
.PP
When a portable service image is attached, matching unit files are copied onto the host into the
/etc/systemd/system\&.attached/
and
/run/systemd/system\&.attached/
directories\&. When an image is detached, the unit files are removed again from these directories\&.
.SH "PROFILES"
.PP
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
/usr/lib/systemd/portable/profile/\&. Additional, local profiles may be defined by placing them in
/etc/systemd/portable/profile/\&. The default profiles are:
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&2.\ \&Profiles
.TS
allbox tab(:);
lB lB.
T{
Name
T}:T{
Description
T}
.T&
l l
l l
l l
l l.
T{
default
T}:T{
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\&.
T}
T{
nonetwork
T}:T{
Very similar to default, but networking is turned off for any services of the portable service image\&.
T}
T{
strict
T}:T{
A profile with very strict settings\&. This profile excludes IPC (D\-Bus) and network access\&.
T}
T{
trusted
T}:T{
A profile with very relaxed settings\&. In this profile the services run with full privileges\&.
T}
.TE
.sp 1
.PP
For details on these profiles and their effects see their precise definitions, e\&.g\&.
/usr/lib/systemd/portable/profile/default/service\&.conf
and similar\&.
.SH "EXIT STATUS"
.PP
On success, 0 is returned, a non\-zero failure code otherwise\&.
.SH "ENVIRONMENT"
.PP
\fI$SYSTEMD_LOG_LEVEL\fR
.RS 4
The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Either one of (in order of decreasing importance)
\fBemerg\fR,
\fBalert\fR,
\fBcrit\fR,
\fBerr\fR,
\fBwarning\fR,
\fBnotice\fR,
\fBinfo\fR,
\fBdebug\fR, or an integer in the range 0\&...7\&. See
\fBsyslog\fR(3)
for more information\&.
.RE
.PP
\fI$SYSTEMD_LOG_COLOR\fR
.RS 4
A boolean\&. If true, messages written to the tty will be colored according to priority\&.
.sp
This setting is only useful when messages are written directly to the terminal, because
\fBjournalctl\fR(1)
and other tools that display logs will color messages based on the log level on their own\&.
.RE
.PP
\fI$SYSTEMD_LOG_TIME\fR
.RS 4
A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
.sp
This setting is only useful when messages are written directly to the terminal or a file, because
\fBjournalctl\fR(1)
and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
.RE
.PP
\fI$SYSTEMD_LOG_LOCATION\fR
.RS 4
A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
.sp
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\&.
.RE
.PP
\fI$SYSTEMD_LOG_TID\fR
.RS 4
A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
.sp
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\&.
.RE
.PP
\fI$SYSTEMD_LOG_TARGET\fR
.RS 4
The destination for log messages\&. One of
\fBconsole\fR
(log to the attached tty),
\fBconsole\-prefixed\fR
(log to the attached tty but with prefixes encoding the log level and "facility", see
\fBsyslog\fR(3),
\fBkmsg\fR
(log to the kernel circular log buffer),
\fBjournal\fR
(log to the journal),
\fBjournal\-or\-kmsg\fR
(log to the journal if available, and to kmsg otherwise),
\fBauto\fR
(determine the appropriate log target automatically, the default),
\fBnull\fR
(disable log output)\&.
.RE
.PP
\fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
.RS 4
Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
"true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
.RE
.PP
\fI$SYSTEMD_PAGER\fR
.RS 4
Pager to use when
\fB\-\-no\-pager\fR
is not given; overrides
\fI$PAGER\fR\&. If neither
\fI$SYSTEMD_PAGER\fR
nor
\fI$PAGER\fR
are set, a set of well\-known pager implementations are tried in turn, including
\fBless\fR(1)
and
\fBmore\fR(1), until one is found\&. If no pager implementation is discovered no pager is invoked\&. Setting this environment variable to an empty string or the value
"cat"
is equivalent to passing
\fB\-\-no\-pager\fR\&.
.sp
Note: if
\fI$SYSTEMD_PAGERSECURE\fR
is not set,
\fI$SYSTEMD_PAGER\fR
(as well as
\fI$PAGER\fR) will be silently ignored\&.
.RE
.PP
\fI$SYSTEMD_LESS\fR
.RS 4
Override the options passed to
\fBless\fR
(by default
"FRSXMK")\&.
.sp
Users might want to change two options in particular:
.PP
\fBK\fR
.RS 4
This option instructs the pager to exit immediately when
Ctrl+C
is pressed\&. To allow
\fBless\fR
to handle
Ctrl+C
itself to switch back to the pager command prompt, unset this option\&.
.sp
If the value of
\fI$SYSTEMD_LESS\fR
does not include
"K", and the pager that is invoked is
\fBless\fR,
Ctrl+C
will be ignored by the executable, and needs to be handled by the pager\&.
.RE
.PP
\fBX\fR
.RS 4
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\&.
.RE
.sp
See
\fBless\fR(1)
for more discussion\&.
.RE
.PP
\fI$SYSTEMD_LESSCHARSET\fR
.RS 4
Override the charset passed to
\fBless\fR
(by default
"utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
.RE
.PP
\fI$SYSTEMD_PAGERSECURE\fR
.RS 4
Takes a boolean argument\&. When true, the "secure" mode of the pager is enabled; if false, disabled\&. If
\fI$SYSTEMD_PAGERSECURE\fR
is not set at all, secure mode is enabled if the effective UID is not the same as the owner of the login session, see
\fBgeteuid\fR(2)
and
\fBsd_pid_get_owner_uid\fR(3)\&. In secure mode,
\fBLESSSECURE=1\fR
will be set when invoking the pager, and the pager shall disable commands that open or create new files or start new subprocesses\&. When
\fI$SYSTEMD_PAGERSECURE\fR
is not set at all, pagers which are not known to implement secure mode will not be used\&. (Currently only
\fBless\fR(1)
implements secure mode\&.)
.sp
Note: when commands are invoked with elevated privileges, for example under
\fBsudo\fR(8)
or
\fBpkexec\fR(1), care must be taken to ensure that unintended interactive features are not enabled\&. "Secure" mode for the pager may be enabled automatically as describe above\&. Setting
\fISYSTEMD_PAGERSECURE=0\fR
or not removing it from the inherited environment allows the user to invoke arbitrary commands\&. Note that if the
\fI$SYSTEMD_PAGER\fR
or
\fI$PAGER\fR
variables are to be honoured,
\fI$SYSTEMD_PAGERSECURE\fR
must be set too\&. It might be reasonable to completely disable the pager using
\fB\-\-no\-pager\fR
instead\&.
.RE
.PP
\fI$SYSTEMD_COLORS\fR
.RS 4
Takes a boolean argument\&. When true,
\fBsystemd\fR
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:
"16",
"256"
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
\fI$TERM\fR
and what the console is connected to\&.
.RE
.PP
\fI$SYSTEMD_URLIFY\fR
.RS 4
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
\fBsystemd\fR
makes based on
\fI$TERM\fR
and other conditions\&.
.RE
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsystemd-sysext\fR(8),
\fBorg.freedesktop.portable1\fR(5),
\fBsystemd-portabled.service\fR(8)
.SH "NOTES"
.IP " 1." 4
Portable Services Documentation
.RS 4
\%https://systemd.io/PORTABLE_SERVICES
.RE