Debian Codegraph @

upstream/debian-trixie/man1/systemd-analyze.1

raw
1 '\" t
2 .TH "SYSTEMD\-ANALYZE" "1" "" "systemd 257.13" "systemd-analyze"
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 systemd-analyze \- Analyze and debug system manager
24 .SH "SYNOPSIS"
25 .HP \w'\fBsystemd\-analyze\fR\ 'u
26 \fBsystemd\-analyze\fR [OPTIONS...] [time]
27 .HP \w'\fBsystemd\-analyze\fR\ 'u
28 \fBsystemd\-analyze\fR [OPTIONS...] blame
29 .HP \w'\fBsystemd\-analyze\fR\ 'u
30 \fBsystemd\-analyze\fR [OPTIONS...] critical\-chain [\fIUNIT\fR...]
31 .HP \w'\fBsystemd\-analyze\fR\ 'u
32 \fBsystemd\-analyze\fR [OPTIONS...] dump [\fIPATTERN\fR...]
33 .HP \w'\fBsystemd\-analyze\fR\ 'u
34 \fBsystemd\-analyze\fR [OPTIONS...] plot [>file\&.svg]
35 .HP \w'\fBsystemd\-analyze\fR\ 'u
36 \fBsystemd\-analyze\fR [OPTIONS...] dot [\fIPATTERN\fR...] [>file\&.dot]
37 .HP \w'\fBsystemd\-analyze\fR\ 'u
38 \fBsystemd\-analyze\fR [OPTIONS...] unit\-files
39 .HP \w'\fBsystemd\-analyze\fR\ 'u
40 \fBsystemd\-analyze\fR [OPTIONS...] unit\-paths
41 .HP \w'\fBsystemd\-analyze\fR\ 'u
42 \fBsystemd\-analyze\fR [OPTIONS...] exit\-status [\fISTATUS\fR...]
43 .HP \w'\fBsystemd\-analyze\fR\ 'u
44 \fBsystemd\-analyze\fR [OPTIONS...] capability [\fICAPABILITY\fR... | {\-m\ |\ \-\-mask}\ \fIMASK\fR]
45 .HP \w'\fBsystemd\-analyze\fR\ 'u
46 \fBsystemd\-analyze\fR [OPTIONS...] condition \fICONDITION\fR\&...
47 .HP \w'\fBsystemd\-analyze\fR\ 'u
48 \fBsystemd\-analyze\fR [OPTIONS...] syscall\-filter [\fISET\fR\&...]
49 .HP \w'\fBsystemd\-analyze\fR\ 'u
50 \fBsystemd\-analyze\fR [OPTIONS...] filesystems [\fISET\fR\&...]
51 .HP \w'\fBsystemd\-analyze\fR\ 'u
52 \fBsystemd\-analyze\fR [OPTIONS...] calendar \fISPEC\fR...
53 .HP \w'\fBsystemd\-analyze\fR\ 'u
54 \fBsystemd\-analyze\fR [OPTIONS...] timestamp \fITIMESTAMP\fR...
55 .HP \w'\fBsystemd\-analyze\fR\ 'u
56 \fBsystemd\-analyze\fR [OPTIONS...] timespan \fISPAN\fR...
57 .HP \w'\fBsystemd\-analyze\fR\ 'u
58 \fBsystemd\-analyze\fR [OPTIONS...] cat\-config \fINAME\fR|\fIPATH\fR...
59 .HP \w'\fBsystemd\-analyze\fR\ 'u
60 \fBsystemd\-analyze\fR [OPTIONS...] compare\-versions \fIVERSION1\fR [\fIOP\fR] \fIVERSION2\fR
61 .HP \w'\fBsystemd\-analyze\fR\ 'u
62 \fBsystemd\-analyze\fR [OPTIONS...] verify \fIFILE\fR...
63 .HP \w'\fBsystemd\-analyze\fR\ 'u
64 \fBsystemd\-analyze\fR [OPTIONS...] security [\fIUNIT\fR...]
65 .HP \w'\fBsystemd\-analyze\fR\ 'u
66 \fBsystemd\-analyze\fR [OPTIONS...] inspect\-elf \fIFILE\fR...
67 .HP \w'\fBsystemd\-analyze\fR\ 'u
68 \fBsystemd\-analyze\fR [OPTIONS...] malloc [\fID\-BUS\ SERVICE\fR...]
69 .HP \w'\fBsystemd\-analyze\fR\ 'u
70 \fBsystemd\-analyze\fR [OPTIONS...] fdstore \fIUNIT\fR...
71 .HP \w'\fBsystemd\-analyze\fR\ 'u
72 \fBsystemd\-analyze\fR [OPTIONS...] image\-policy \fIPOLICY\fR...
73 .HP \w'\fBsystemd\-analyze\fR\ 'u
74 \fBsystemd\-analyze\fR [OPTIONS...] has\-tpm2
75 .HP \w'\fBsystemd\-analyze\fR\ 'u
76 \fBsystemd\-analyze\fR [OPTIONS...] pcrs [\fIPCR\fR...]
77 .HP \w'\fBsystemd\-analyze\fR\ 'u
78 \fBsystemd\-analyze\fR [OPTIONS...] srk [\fI>FILE\fR]
79 .HP \w'\fBsystemd\-analyze\fR\ 'u
80 \fBsystemd\-analyze\fR [OPTIONS...] architectures [\fINAME\fR...]
81 .HP \w'\fBsystemd\-analyze\fR\ 'u
82 \fBsystemd\-analyze\fR [OPTIONS...] smbios11
83 .SH "DESCRIPTION"
84 .PP
85 \fBsystemd\-analyze\fR
86 may be used to determine system boot\-up performance statistics and retrieve other state and tracing information from the system and service manager, and to verify the correctness of unit files\&. It is also used to access special functions useful for advanced system manager debugging\&.
87 .PP
88 If no command is passed,
89 \fBsystemd\-analyze time\fR
90 is implied\&.
91 .SS "systemd\-analyze time"
92 .PP
93 This command prints the time spent in the kernel before userspace has been reached, the time spent in the initrd before normal system userspace has been reached, and the time normal system userspace took to initialize\&. Note that these measurements simply measure the time passed up to the point where all system services have been spawned, but not necessarily until they fully finished initialization or the disk is idle\&.
94 .PP
95 \fBExample\ \&1.\ \&Show how long the boot took\fR
96 .sp
97 .if n \{\
98 .RS 4
99 .\}
100 .nf
101 # in a container
102 $ systemd\-analyze time
103 Startup finished in 296ms (userspace)
104 multi\-user\&.target reached after 275ms in userspace
105
106 # on a real machine
107 $ systemd\-analyze time
108 Startup finished in 2\&.584s (kernel) + 19\&.176s (initrd) + 47\&.847s (userspace) = 1min 9\&.608s
109 multi\-user\&.target reached after 47\&.820s in userspace
110 .fi
111 .if n \{\
112 .RE
113 .\}
114 .SS "systemd\-analyze blame"
115 .PP
116 This command prints a list of all running units, ordered by the time they took to initialize\&. This information may be used to optimize boot\-up times\&. Note that the output might be misleading as the initialization of one service might be slow simply because it waits for the initialization of another service to complete\&. Also note:
117 \fBsystemd\-analyze blame\fR
118 does not display results for services with
119 \fIType=simple\fR, because systemd considers such services to be started immediately, hence no measurement of the initialization delays can be done\&. Also note that this command only shows the time units took for starting up, it does not show how long unit jobs spent in the execution queue\&. In particular it shows the time units spent in
120 "activating"
121 state, which is not defined for units such as device units that transition directly from
122 "inactive"
123 to
124 "active"\&. This command hence gives an impression of the performance of program code, but cannot accurately reflect latency introduced by waiting for hardware and similar events\&.
125 .PP
126 \fBExample\ \&2.\ \&Show which units took the most time during boot\fR
127 .sp
128 .if n \{\
129 .RS 4
130 .\}
131 .nf
132 $ systemd\-analyze blame
133 32\&.875s pmlogger\&.service
134 20\&.905s systemd\-networkd\-wait\-online\&.service
135 13\&.299s dev\-vda1\&.device
136 \&.\&.\&.
137 23ms sysroot\&.mount
138 11ms initrd\-udevadm\-cleanup\-db\&.service
139 3ms sys\-kernel\-config\&.mount
140 .fi
141 .if n \{\
142 .RE
143 .\}
144 .SS "systemd\-analyze critical\-chain [\fIUNIT\fR\&.\&.\&.]"
145 .PP
146 This command prints a tree of the time\-critical chain of units (for each of the specified
147 \fIUNIT\fRs or for the default target otherwise)\&. The time after the unit is active or started is printed after the "@" character\&. The time the unit takes to start is printed after the "+" character\&. Note that the output might be misleading as the initialization of services might depend on socket activation and because of the parallel execution of units\&. Also, similarly to the
148 \fBblame\fR
149 command, this only takes into account the time units spent in
150 "activating"
151 state, and hence does not cover units that never went through an
152 "activating"
153 state (such as device units that transition directly from
154 "inactive"
155 to
156 "active")\&. Moreover, it does not show information on jobs (and in particular not jobs that timed out)\&.
157 .PP
158 \fBExample\ \&3.\ \&systemd\-analyze critical\-chain\fR
159 .sp
160 .if n \{\
161 .RS 4
162 .\}
163 .nf
164 $ systemd\-analyze critical\-chain
165 multi\-user\&.target @47\&.820s
166 └─pmie\&.service @35\&.968s +548ms
167 └─pmcd\&.service @33\&.715s +2\&.247s
168 └─network\-online\&.target @33\&.712s
169 └─systemd\-networkd\-wait\-online\&.service @12\&.804s +20\&.905s
170 └─systemd\-networkd\&.service @11\&.109s +1\&.690s
171 └─systemd\-udevd\&.service @9\&.201s +1\&.904s
172 └─systemd\-tmpfiles\-setup\-dev\&.service @7\&.306s +1\&.776s
173 └─kmod\-static\-nodes\&.service @6\&.976s +177ms
174 └─systemd\-journald\&.socket
175 └─system\&.slice
176 └─\-\&.slice
177 .fi
178 .if n \{\
179 .RE
180 .\}
181 .SS "systemd\-analyze dump [\fIpattern\fR\&...]"
182 .PP
183 Without any parameter, this command outputs a (usually very long) human\-readable serialization of the complete service manager state\&. Optional glob pattern may be specified, causing the output to be limited to units whose names match one of the patterns\&. The output format is subject to change without notice and should not be parsed by applications\&. This command is rate limited for unprivileged users\&.
184 .PP
185 \fBExample\ \&4.\ \&Show the internal state of user manager\fR
186 .sp
187 .if n \{\
188 .RS 4
189 .\}
190 .nf
191 $ systemd\-analyze \-\-user dump
192 Timestamp userspace: Thu 2019\-03\-14 23:28:07 CET
193 Timestamp finish: Thu 2019\-03\-14 23:28:07 CET
194 Timestamp generators\-start: Thu 2019\-03\-14 23:28:07 CET
195 Timestamp generators\-finish: Thu 2019\-03\-14 23:28:07 CET
196 Timestamp units\-load\-start: Thu 2019\-03\-14 23:28:07 CET
197 Timestamp units\-load\-finish: Thu 2019\-03\-14 23:28:07 CET
198 \-> Unit proc\-timer_list\&.mount:
199 Description: /proc/timer_list
200 \&.\&.\&.
201 \-> Unit default\&.target:
202 Description: Main user target
203 \&.\&.\&.
204 .fi
205 .if n \{\
206 .RE
207 .\}
208 .SS "systemd\-analyze malloc [\fID\-Bus service\fR\&...]"
209 .PP
210 This command can be used to request the output of the internal memory state (as returned by
211 \fBmalloc_info\fR(3)) of a D\-Bus service\&. If no service is specified, the query will be sent to
212 org\&.freedesktop\&.systemd1
213 (the system or user service manager)\&. The output format is not guaranteed to be stable and should not be parsed by applications\&.
214 .PP
215 The service must implement the
216 org\&.freedesktop\&.MemoryAllocation1
217 interface\&. In the systemd suite, it is currently only implemented by the manager\&.
218 .SS "systemd\-analyze plot"
219 .PP
220 This command prints either an SVG graphic, detailing which system services have been started at what time, highlighting the time they spent on initialization, or the raw time data in JSON or table format\&.
221 .PP
222 \fBExample\ \&5.\ \&Plot a bootchart\fR
223 .sp
224 .if n \{\
225 .RS 4
226 .\}
227 .nf
228 $ systemd\-analyze plot >bootup\&.svg
229 $ eog bootup\&.svg&
230 .fi
231 .if n \{\
232 .RE
233 .\}
234 .PP
235 Note that this plot is based on the most recent per\-unit timing data of loaded units\&. This means that if a unit gets started, then stopped and then started again the information shown will cover the most recent start cycle, not the first one\&. Thus it is recommended to consult this information only shortly after boot, so that this distinction does not matter\&. Moreover, units that are not referenced by any other unit through a dependency might be unloaded by the service manager once they terminate (and did not fail)\&. Such units will not show up in the plot\&.
236 .SS "systemd\-analyze dot [\fIpattern\fR\&.\&.\&.]"
237 .PP
238 This command generates textual dependency graph description in dot format for further processing with the GraphViz
239 \fBdot\fR(1)
240 tool\&. Use a command line like
241 \fBsystemd\-analyze dot | dot \-Tsvg >systemd\&.svg\fR
242 to generate a graphical dependency tree\&. Unless
243 \fB\-\-order\fR
244 or
245 \fB\-\-require\fR
246 is passed, the generated graph will show both ordering and requirement dependencies\&. Optional pattern globbing style specifications (e\&.g\&.
247 *\&.target) may be given at the end\&. A unit dependency is included in the graph if any of these patterns match either the origin or destination node\&.
248 .PP
249 \fBExample\ \&6.\ \&Plot all dependencies of any unit whose name starts with "avahi\-daemon"\fR
250 .sp
251 .if n \{\
252 .RS 4
253 .\}
254 .nf
255 $ systemd\-analyze dot \*(Aqavahi\-daemon\&.*\*(Aq | dot \-Tsvg >avahi\&.svg
256 $ eog avahi\&.svg
257 .fi
258 .if n \{\
259 .RE
260 .\}
261 .PP
262 \fBExample\ \&7.\ \&Plot the dependencies between all known target units\fR
263 .sp
264 .if n \{\
265 .RS 4
266 .\}
267 .nf
268 $ systemd\-analyze dot \-\-to\-pattern=\*(Aq*\&.target\*(Aq \-\-from\-pattern=\*(Aq*\&.target\*(Aq \e
269 | dot \-Tsvg >targets\&.svg
270 $ eog targets\&.svg
271 .fi
272 .if n \{\
273 .RE
274 .\}
275 .SS "systemd\-analyze unit\-paths"
276 .PP
277 This command outputs a list of all directories from which unit files,
278 \&.d
279 overrides, and
280 \&.wants,
281 \&.requires
282 symlinks may be loaded\&. Combine with
283 \fB\-\-user\fR
284 to retrieve the list for the user manager instance, and
285 \fB\-\-global\fR
286 for the global configuration of user manager instances\&.
287 .PP
288 \fBExample\ \&8.\ \&Show all paths for generated units\fR
289 .sp
290 .if n \{\
291 .RS 4
292 .\}
293 .nf
294 $ systemd\-analyze unit\-paths | grep \*(Aq^/run\*(Aq
295 /run/systemd/system\&.control
296 /run/systemd/transient
297 /run/systemd/generator\&.early
298 /run/systemd/system
299 /run/systemd/system\&.attached
300 /run/systemd/generator
301 /run/systemd/generator\&.late
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .PP
307 Note that this verb prints the list that is compiled into
308 \fBsystemd\-analyze\fR
309 itself, and does not communicate with the running manager\&. Use
310 .sp
311 .if n \{\
312 .RS 4
313 .\}
314 .nf
315 systemctl [\-\-user] [\-\-global] show \-p UnitPath \-\-value
316 .fi
317 .if n \{\
318 .RE
319 .\}
320 .sp
321 to retrieve the actual list that the manager uses, with any empty directories omitted\&.
322 .SS "systemd\-analyze exit\-status [\fISTATUS\fR\&.\&.\&.]"
323 .PP
324 This command prints a list of exit statuses along with their "class", i\&.e\&. the source of the definition (one of
325 "libc",
326 "systemd",
327 "LSB", or
328 "BSD"), see the Process Exit Codes section in
329 \fBsystemd.exec\fR(5)\&. If no additional arguments are specified, all known statuses are shown\&. Otherwise, only the definitions for the specified codes are shown\&.
330 .PP
331 \fBExample\ \&9.\ \&Show some example exit status names\fR
332 .sp
333 .if n \{\
334 .RS 4
335 .\}
336 .nf
337 $ systemd\-analyze exit\-status 0 1 {63\&.\&.65}
338 NAME STATUS CLASS
339 SUCCESS 0 libc
340 FAILURE 1 libc
341 \- 63 \-
342 USAGE 64 BSD
343 DATAERR 65 BSD
344 .fi
345 .if n \{\
346 .RE
347 .\}
348 .SS "systemd\-analyze capability [\fICAPABILITY\fR... | {\-m\ |\ \-\-mask}\ \fIMASK\fR]"
349 .PP
350 This command prints a list of Linux capabilities along with their numeric IDs\&. See
351 \fBcapabilities\fR(7)
352 for details\&. If no argument is specified the full list of capabilities known to the service manager and the kernel is shown\&. Capabilities defined by the kernel but not known to the service manager are shown as
353 "cap_???"\&. Optionally, if arguments are specified they may refer to specific cabilities by name or numeric ID, in which case only the indicated capabilities are shown in the table\&.
354 .PP
355 Alternatively, if
356 \fB\-\-mask\fR
357 is passed, a single numeric argument must be specified, which is interpreted as a hexadecimal capability mask\&. In this case, only the capabilities present in the mask are shown in the table\&. This mode is intended to aid in decoding capability sets available via various debugging interfaces (e\&.g\&.
358 "/proc/PID/status")\&.
359 .PP
360 \fBExample\ \&10.\ \&Show some example capability names\fR
361 .sp
362 .if n \{\
363 .RS 4
364 .\}
365 .nf
366 $ systemd\-analyze capability 0 1 {30\&.\&.32}
367 NAME NUMBER
368 cap_chown 0
369 cap_dac_override 1
370 cap_audit_control 30
371 cap_setfcap 31
372 cap_mac_override 32
373 .fi
374 .if n \{\
375 .RE
376 .\}
377 .PP
378 \fBExample\ \&11.\ \&Decode a capability mask extracted from /proc\fR
379 .sp
380 .if n \{\
381 .RS 4
382 .\}
383 .nf
384 $ systemd\-analyze capability \-m 0000000000003c00
385 NAME NUMBER
386 cap_net_bind_service 10
387 cap_net_broadcast 11
388 cap_net_admin 12
389 cap_net_raw 13
390 .fi
391 .if n \{\
392 .RE
393 .\}
394 .SS "systemd\-analyze condition \fICONDITION\fR\&.\&.\&."
395 .PP
396 This command will evaluate
397 \fICondition*=\&.\&.\&.\fR
398 and
399 \fIAssert*=\&.\&.\&.\fR
400 assignments, and print their values, and the resulting value of the combined condition set\&. See
401 \fBsystemd.unit\fR(5)
402 for a list of available conditions and asserts\&.
403 .PP
404 \fBExample\ \&12.\ \&Evaluate conditions that check kernel versions\fR
405 .sp
406 .if n \{\
407 .RS 4
408 .\}
409 .nf
410 $ systemd\-analyze condition \*(AqConditionKernelVersion = ! <4\&.0\*(Aq \e
411 \*(AqConditionKernelVersion = >=5\&.1\*(Aq \e
412 \*(AqConditionACPower=|false\*(Aq \e
413 \*(AqConditionArchitecture=|!arm\*(Aq \e
414 \*(AqAssertPathExists=/etc/os\-release\*(Aq
415 test\&.service: AssertPathExists=/etc/os\-release succeeded\&.
416 Asserts succeeded\&.
417 test\&.service: ConditionArchitecture=|!arm succeeded\&.
418 test\&.service: ConditionACPower=|false failed\&.
419 test\&.service: ConditionKernelVersion=>=5\&.1 succeeded\&.
420 test\&.service: ConditionKernelVersion=!<4\&.0 succeeded\&.
421 Conditions succeeded\&.
422 .fi
423 .if n \{\
424 .RE
425 .\}
426 .SS "systemd\-analyze syscall\-filter [\fISET\fR\&.\&.\&.]"
427 .PP
428 This command will list system calls contained in the specified system call set
429 \fISET\fR, or all known sets if no sets are specified\&. Argument
430 \fISET\fR
431 must include the
432 "@"
433 prefix\&.
434 .SS "systemd\-analyze filesystems [\fISET\fR\&.\&.\&.]"
435 .PP
436 This command will list filesystems in the specified filesystem set
437 \fISET\fR, or all known sets if no sets are specified\&. Argument
438 \fISET\fR
439 must include the
440 "@"
441 prefix\&.
442 .SS "systemd\-analyze calendar \fIEXPRESSION\fR\&.\&.\&."
443 .PP
444 This command will parse and normalize repetitive calendar time events, and will calculate when they elapse next\&. This takes the same input as the
445 \fIOnCalendar=\fR
446 setting in
447 \fBsystemd.timer\fR(5), following the syntax described in
448 \fBsystemd.time\fR(7)\&. By default, only the next time the calendar expression will elapse is shown; use
449 \fB\-\-iterations=\fR
450 to show the specified number of next times the expression elapses\&. Each time the expression elapses forms a timestamp, see the
451 \fBtimestamp\fR
452 verb below\&.
453 .PP
454 \fBExample\ \&13.\ \&Show leap days in the near future\fR
455 .sp
456 .if n \{\
457 .RS 4
458 .\}
459 .nf
460 $ systemd\-analyze calendar \-\-iterations=5 \*(Aq*\-2\-29 0:0:0\*(Aq
461 Original form: *\-2\-29 0:0:0
462 Normalized form: *\-02\-29 00:00:00
463 Next elapse: Sat 2020\-02\-29 00:00:00 UTC
464 From now: 11 months 15 days left
465 Iter\&. #2: Thu 2024\-02\-29 00:00:00 UTC
466 From now: 4 years 11 months left
467 Iter\&. #3: Tue 2028\-02\-29 00:00:00 UTC
468 From now: 8 years 11 months left
469 Iter\&. #4: Sun 2032\-02\-29 00:00:00 UTC
470 From now: 12 years 11 months left
471 Iter\&. #5: Fri 2036\-02\-29 00:00:00 UTC
472 From now: 16 years 11 months left
473 .fi
474 .if n \{\
475 .RE
476 .\}
477 .SS "systemd\-analyze timestamp \fITIMESTAMP\fR\&.\&.\&."
478 .PP
479 This command parses a timestamp (i\&.e\&. a single point in time) and outputs the normalized form and the difference between this timestamp and now\&. The timestamp should adhere to the syntax documented in
480 \fBsystemd.time\fR(7), section "PARSING TIMESTAMPS"\&.
481 .PP
482 \fBExample\ \&14.\ \&Show parsing of timestamps\fR
483 .sp
484 .if n \{\
485 .RS 4
486 .\}
487 .nf
488 $ systemd\-analyze timestamp yesterday now tomorrow
489 Original form: yesterday
490 Normalized form: Mon 2019\-05\-20 00:00:00 CEST
491 (in UTC): Sun 2019\-05\-19 22:00:00 UTC
492 UNIX seconds: @15583032000
493 From now: 1 day 9h ago
494
495 Original form: now
496 Normalized form: Tue 2019\-05\-21 09:48:39 CEST
497 (in UTC): Tue 2019\-05\-21 07:48:39 UTC
498 UNIX seconds: @1558424919\&.659757
499 From now: 43us ago
500
501 Original form: tomorrow
502 Normalized form: Wed 2019\-05\-22 00:00:00 CEST
503 (in UTC): Tue 2019\-05\-21 22:00:00 UTC
504 UNIX seconds: @15584760000
505 From now: 14h left
506 .fi
507 .if n \{\
508 .RE
509 .\}
510 .SS "systemd\-analyze timespan \fIEXPRESSION\fR\&.\&.\&."
511 .PP
512 This command parses a time span (i\&.e\&. a difference between two timestamps) and outputs the normalized form and the equivalent value in microseconds\&. The time span should adhere to the syntax documented in
513 \fBsystemd.time\fR(7), section "PARSING TIME SPANS"\&. Values without units are parsed as seconds\&.
514 .PP
515 \fBExample\ \&15.\ \&Show parsing of timespans\fR
516 .sp
517 .if n \{\
518 .RS 4
519 .\}
520 .nf
521 $ systemd\-analyze timespan 1s 300s \*(Aq1year 0\&.000001s\*(Aq
522 Original: 1s
523 μs: 1000000
524 Human: 1s
525
526 Original: 300s
527 μs: 300000000
528 Human: 5min
529
530 Original: 1year 0\&.000001s
531 μs: 31557600000001
532 Human: 1y 1us
533 .fi
534 .if n \{\
535 .RE
536 .\}
537 .SS "systemd\-analyze cat\-config \fINAME\fR|\fIPATH\fR\&.\&.\&."
538 .PP
539 This command is similar to
540 \fBsystemctl cat\fR, but operates on config files\&. It will copy the contents of a config file and any drop\-ins to standard output, using the usual systemd set of directories and rules for precedence\&. Each argument must be either an absolute path including the prefix (such as
541 /etc/systemd/logind\&.conf
542 or
543 /usr/lib/systemd/logind\&.conf), or a name relative to the prefix (such as
544 systemd/logind\&.conf)\&.
545 .PP
546 \fBExample\ \&16.\ \&Showing logind configuration\fR
547 .sp
548 .if n \{\
549 .RS 4
550 .\}
551 .nf
552 $ systemd\-analyze cat\-config systemd/logind\&.conf
553 # /etc/systemd/logind\&.conf
554 \&.\&.\&.
555 [Login]
556 NAutoVTs=8
557 \&.\&.\&.
558
559 # /usr/lib/systemd/logind\&.conf\&.d/20\-test\&.conf
560 \&.\&.\&. some override from another package
561
562 # /etc/systemd/logind\&.conf\&.d/50\-override\&.conf
563 \&.\&.\&. some administrator override
564 .fi
565 .if n \{\
566 .RE
567 .\}
568 .SS "systemd\-analyze compare\-versions \fIVERSION1\fR [\fIOP\fR] \fIVERSION2\fR"
569 .PP
570 This command has two distinct modes of operation, depending on whether the operator
571 \fIOP\fR
572 is specified\&.
573 .PP
574 In the first mode \(em when
575 \fIOP\fR
576 is not specified \(em, it will compare the two version strings and print either
577 "\fIVERSION1\fR < \fIVERSION2\fR", or
578 "\fIVERSION1\fR == \fIVERSION2\fR", or
579 "\fIVERSION1\fR > \fIVERSION2\fR"
580 as appropriate\&.
581 .PP
582 The exit status is
583 \fB0\fR
584 if the versions are equal,
585 \fB11\fR
586 if the version of the right is smaller, and
587 \fB12\fR
588 if the version of the left is smaller\&. (This matches the convention used by
589 \fBrpmdev\-vercmp\fR\&.)
590 .PP
591 In the second mode \(em when
592 \fIOP\fR
593 is specified \(em it will compare the two version strings using the operation
594 \fIOP\fR
595 and return
596 \fB0\fR
597 (success) if they condition is satisfied, and
598 \fB1\fR
599 (failure) otherwise\&.
600 \fBOP\fR
601 may be
602 \fBlt\fR,
603 \fBle\fR,
604 \fBeq\fR,
605 \fBne\fR,
606 \fBge\fR,
607 \fBgt\fR\&. In this mode, no output is printed\&. (This matches the convention used by
608 \fBdpkg\fR(1)
609 \fB\-\-compare\-versions\fR\&.)
610 .PP
611 \fBExample\ \&17.\ \&Compare versions of a package\fR
612 .sp
613 .if n \{\
614 .RS 4
615 .\}
616 .nf
617 $ systemd\-analyze compare\-versions systemd\-250~rc1\&.fc36\&.aarch64 systemd\-251\&.fc36\&.aarch64
618 systemd\-250~rc1\&.fc36\&.aarch64 < systemd\-251\&.fc36\&.aarch64
619 $ echo $?
620 12
621
622 $ systemd\-analyze compare\-versions 1 lt 2; echo $?
623 0
624 $ systemd\-analyze compare\-versions 1 ge 2; echo $?
625 1
626 .fi
627 .if n \{\
628 .RE
629 .\}
630 .SS "systemd\-analyze verify \fIFILE\fR\&.\&.\&."
631 .PP
632 This command will load unit files and print warnings if any errors are detected\&. Files specified on the command line will be loaded, but also any other units referenced by them\&. A unit\*(Aqs name on disk can be overridden by specifying an alias after a colon; see below for an example\&. The full unit search path is formed by combining the directories for all command line arguments, and the usual unit load paths\&. The variable
633 \fI$SYSTEMD_UNIT_PATH\fR
634 is supported, and may be used to replace or augment the compiled in set of unit load paths; see
635 \fBsystemd.unit\fR(5)\&. All units files present in the directories containing the command line arguments will be used in preference to the other paths\&. If a template unit without an instance name is specified (e\&.g\&.
636 foo@\&.service),
637 "test_instance"
638 will be used as the instance name, which can be controlled by
639 \fB\-\-instance=\fR
640 option\&.
641 .PP
642 The following errors are currently detected:
643 .sp
644 .RS 4
645 .ie n \{\
646 \h'-04'\(bu\h'+03'\c
647 .\}
648 .el \{\
649 .sp -1
650 .IP \(bu 2.3
651 .\}
652 unknown sections and directives,
653 .RE
654 .sp
655 .RS 4
656 .ie n \{\
657 \h'-04'\(bu\h'+03'\c
658 .\}
659 .el \{\
660 .sp -1
661 .IP \(bu 2.3
662 .\}
663 missing dependencies which are required to start the given unit,
664 .RE
665 .sp
666 .RS 4
667 .ie n \{\
668 \h'-04'\(bu\h'+03'\c
669 .\}
670 .el \{\
671 .sp -1
672 .IP \(bu 2.3
673 .\}
674 man pages listed in
675 \fIDocumentation=\fR
676 which are not found in the system,
677 .RE
678 .sp
679 .RS 4
680 .ie n \{\
681 \h'-04'\(bu\h'+03'\c
682 .\}
683 .el \{\
684 .sp -1
685 .IP \(bu 2.3
686 .\}
687 commands listed in
688 \fIExecStart=\fR
689 and similar which are not found in the system or not executable\&.
690 .RE
691 .PP
692 \fBExample\ \&18.\ \&Misspelt directives\fR
693 .sp
694 .if n \{\
695 .RS 4
696 .\}
697 .nf
698 $ cat \&./user\&.slice
699 [Unit]
700 WhatIsThis=11
701 Documentation=man:nosuchfile(1)
702 Requires=different\&.service
703
704 [Service]
705 Description=x
706
707 $ systemd\-analyze verify \&./user\&.slice
708 [\&./user\&.slice:9] Unknown lvalue \*(AqWhatIsThis\*(Aq in section \*(AqUnit\*(Aq
709 [\&./user\&.slice:13] Unknown section \*(AqService\*(Aq\&. Ignoring\&.
710 Error: org\&.freedesktop\&.systemd1\&.LoadFailed:
711 Unit different\&.service failed to load:
712 No such file or directory\&.
713 Failed to create user\&.slice/start: Invalid argument
714 user\&.slice: man nosuchfile(1) command failed with code 16
715 .fi
716 .if n \{\
717 .RE
718 .\}
719 .PP
720 \fBExample\ \&19.\ \&Missing service units\fR
721 .sp
722 .if n \{\
723 .RS 4
724 .\}
725 .nf
726 $ tail \&./a\&.socket \&./b\&.socket
727 ==> \&./a\&.socket <==
728 [Socket]
729 ListenStream=100
730
731 ==> \&./b\&.socket <==
732 [Socket]
733 ListenStream=100
734 Accept=yes
735
736 $ systemd\-analyze verify \&./a\&.socket \&./b\&.socket
737 Service a\&.service not loaded, a\&.socket cannot be started\&.
738 Service b@0\&.service not loaded, b\&.socket cannot be started\&.
739 .fi
740 .if n \{\
741 .RE
742 .\}
743 .PP
744 \fBExample\ \&20.\ \&Aliasing a unit\fR
745 .sp
746 .if n \{\
747 .RS 4
748 .\}
749 .nf
750 $ cat /tmp/source
751 [Unit]
752 Description=Hostname printer
753
754 [Service]
755 Type=simple
756 ExecStart=/usr/bin/echo %H
757 MysteryKey=true
758
759 $ systemd\-analyze verify /tmp/source
760 Failed to prepare filename /tmp/source: Invalid argument
761
762 $ systemd\-analyze verify /tmp/source:alias\&.service
763 alias\&.service:7: Unknown key name \*(AqMysteryKey\*(Aq in section \*(AqService\*(Aq, ignoring\&.
764 .fi
765 .if n \{\
766 .RE
767 .\}
768 .SS "systemd\-analyze security [\fIUNIT\fR\&.\&.\&.]"
769 .PP
770 This command analyzes the security and sandboxing settings of one or more specified service units\&. If at least one unit name is specified the security settings of the specified service units are inspected and a detailed analysis is shown\&. If no unit name is specified, all currently loaded, long\-running service units are inspected and a terse table with results shown\&. The command checks for various security\-related service settings, assigning each a numeric "exposure level" value, depending on how important a setting is\&. It then calculates an overall exposure level for the whole unit, which is an estimation in the range 0\&.0\&...10\&.0 indicating how exposed a service is security\-wise\&. High exposure levels indicate very little applied sandboxing\&. Low exposure levels indicate tight sandboxing and strongest security restrictions\&. Note that this only analyzes the per\-service security features systemd itself implements\&. This means that any additional security mechanisms applied by the service code itself are not accounted for\&. The exposure level determined this way should not be misunderstood: a high exposure level neither means that there is no effective sandboxing applied by the service code itself, nor that the service is actually vulnerable to remote or local attacks\&. High exposure levels do indicate however that most likely the service might benefit from additional settings applied to them\&.
771 .PP
772 Please note that many of the security and sandboxing settings individually can be circumvented \(em unless combined with others\&. For example, if a service retains the privilege to establish or undo mount points many of the sandboxing options can be undone by the service code itself\&. Due to that is essential that each service uses the most comprehensive and strict sandboxing and security settings possible\&. The tool will take into account some of these combinations and relationships between the settings, but not all\&. Also note that the security and sandboxing settings analyzed here only apply to the operations executed by the service code itself\&. If a service has access to an IPC system (such as D\-Bus) it might request operations from other services that are not subject to the same restrictions\&. Any comprehensive security and sandboxing analysis is hence incomplete if the IPC access policy is not validated too\&.
773 .PP
774 \fBExample\ \&21.\ \&Analyze systemd\-logind\&.service\fR
775 .sp
776 .if n \{\
777 .RS 4
778 .\}
779 .nf
780 $ systemd\-analyze security \-\-no\-pager systemd\-logind\&.service
781 NAME DESCRIPTION EXPOSURE
782 ✗ PrivateNetwork= Service has access to the host\*(Aqs network 0\&.5
783 ✗ User=/DynamicUser= Service runs as root user 0\&.4
784 ✗ DeviceAllow= Service has no device ACL 0\&.2
785 ✓ IPAddressDeny= Service blocks all IP address ranges
786 \&.\&.\&.
787 → Overall exposure level for systemd\-logind\&.service: 4\&.1 OK 🙂
788 .fi
789 .if n \{\
790 .RE
791 .\}
792 .SS "systemd\-analyze inspect\-elf \fIFILE\fR\&.\&.\&."
793 .PP
794 This command will load the specified files, and if they are ELF objects (executables, libraries, core files, etc\&.) it will parse the embedded packaging metadata, if any, and print it in a table or json format\&. See the
795 \m[blue]\fBPackaging Metadata\fR\m[]\&\s-2\u[1]\d\s+2
796 documentation for more information\&.
797 .PP
798 \fBExample\ \&22.\ \&Print information about a core file as JSON\fR
799 .sp
800 .if n \{\
801 .RS 4
802 .\}
803 .nf
804 $ systemd\-analyze inspect\-elf \-\-json=pretty \e
805 core\&.fsverity\&.1000\&.f77dac5dc161402aa44e15b7dd9dcf97\&.58561\&.1637106137000000
806 {
807 "elfType" : "coredump",
808 "elfArchitecture" : "AMD x86\-64",
809 "/home/bluca/git/fsverity\-utils/fsverity" : {
810 "type" : "deb",
811 "name" : "fsverity\-utils",
812 "version" : "1\&.3\-1",
813 "buildId" : "7c895ecd2a271f93e96268f479fdc3c64a2ec4ee"
814 },
815 "/home/bluca/git/fsverity\-utils/libfsverity\&.so\&.0" : {
816 "type" : "deb",
817 "name" : "fsverity\-utils",
818 "version" : "1\&.3\-1",
819 "buildId" : "b5e428254abf14237b0ae70ed85fffbb98a78f88"
820 }
821 }
822 .fi
823 .if n \{\
824 .RE
825 .\}
826 .SS "systemd\-analyze fdstore \fIUNIT\fR\&.\&.\&."
827 .PP
828 Lists the current contents of the specified service unit\*(Aqs file descriptor store\&. This shows names, inode types, device numbers, inode numbers, paths and open modes of the open file descriptors\&. The specified units must have
829 \fIFileDescriptorStoreMax=\fR
830 enabled, see
831 \fBsystemd.service\fR(5)
832 for details\&.
833 .PP
834 \fBExample\ \&23.\ \&Table output\fR
835 .sp
836 .if n \{\
837 .RS 4
838 .\}
839 .nf
840 $ systemd\-analyze fdstore systemd\-journald\&.service
841 FDNAME TYPE DEVNO INODE RDEVNO PATH FLAGS
842 stored sock 0:8 4218620 \- socket:[4218620] ro
843 stored sock 0:8 4213198 \- socket:[4213198] ro
844 stored sock 0:8 4213190 \- socket:[4213190] ro
845 \&...
846 .fi
847 .if n \{\
848 .RE
849 .\}
850 .PP
851 Note: the "DEVNO" column refers to the major/minor numbers of the device node backing the file system the file descriptor\*(Aqs inode is on\&. The "RDEVNO" column refers to the major/minor numbers of the device node itself if the file descriptor refers to one\&. Compare with corresponding
852 \fI\&.st_dev\fR
853 and
854 \fI\&.st_rdev\fR
855 fields in
856 \fBstruct stat\fR
857 (see
858 \fBstat\fR(2)
859 for details)\&. The listed inode numbers in the "INODE" column are on the file system indicated by "DEVNO"\&.
860 .SS "systemd\-analyze image\-policy \fIPOLICY\fR\&..."
861 .PP
862 This command analyzes the specified image policy string, as per
863 \fBsystemd.image-policy\fR(7)\&. The policy is normalized and simplified\&. For each currently defined partition identifier (as per the
864 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2) the effect of the image policy string is shown in tabular form\&.
865 .PP
866 \fBExample\ \&24.\ \&Example Output\fR
867 .sp
868 .if n \{\
869 .RS 4
870 .\}
871 .nf
872 $ systemd\-analyze image\-policy swap=encrypted:usr=read\-only\-on+verity:root=encrypted
873 Analyzing policy: root=encrypted:usr=verity+read\-only\-on:swap=encrypted
874 Long form: root=encrypted:usr=verity+read\-only\-on:swap=encrypted:=unused+absent
875
876 PARTITION MODE READ\-ONLY GROWFS
877 root encrypted \- \-
878 usr verity yes \-
879 home ignore \- \-
880 srv ignore \- \-
881 esp ignore \- \-
882 xbootldr ignore \- \-
883 swap encrypted \- \-
884 root\-verity ignore \- \-
885 usr\-verity unprotected yes \-
886 root\-verity\-sig ignore \- \-
887 usr\-verity\-sig ignore \- \-
888 tmp ignore \- \-
889 var ignore \- \-
890 default ignore \- \-
891 .fi
892 .if n \{\
893 .RE
894 .\}
895 .SS "systemd\-analyze has\-tpm2"
896 .PP
897 Reports whether the system is equipped with a usable TPM2 device\&. If a TPM2 device has been discovered, is supported, and is being used by firmware, by the OS kernel drivers and by userspace (i\&.e\&. systemd) this prints
898 "yes"
899 and exits with exit status zero\&. If no such device is discovered/supported/used, prints
900 "no"\&. Otherwise, prints
901 "partial"\&. In either of these two cases exits with non\-zero exit status\&. It also shows five lines indicating separately whether firmware, drivers, the system, the kernel and libraries discovered/support/use TPM2\&. Currently, required libraries are
902 libtss2\-esys\&.so\&.0,
903 libtss2\-rc\&.so\&.0, and
904 libtss2\-mu\&.so\&.0\&. The requirement may be changed in the future release\&.
905 .PP
906 Note, this checks for TPM 2\&.0 devices only, and does not consider TPM 1\&.2 at all\&.
907 .PP
908 Combine with
909 \fB\-\-quiet\fR
910 to suppress the output\&.
911 .PP
912 \fBExample\ \&25.\ \&Example Output\fR
913 .sp
914 .if n \{\
915 .RS 4
916 .\}
917 .nf
918 yes
919 +firmware
920 +driver
921 +system
922 +subsystem
923 +libraries
924 +libtss2\-esys\&.so\&.0
925 +libtss2\-rc\&.so\&.0
926 +libtss2\-mu\&.so\&.0
927 .fi
928 .if n \{\
929 .RE
930 .\}
931 .PP
932 Added in version 257\&.
933 .SS "systemd\-analyze pcrs [\fIPCR\fR\&...]"
934 .PP
935 This command shows the known TPM2 PCRs along with their identifying names and current values\&.
936 .PP
937 \fBExample\ \&26.\ \&Example Output\fR
938 .sp
939 .if n \{\
940 .RS 4
941 .\}
942 .nf
943 $ systemd\-analyze pcrs
944 NR NAME SHA256
945 0 platform\-code bcd2eb527108bbb1f5528409bcbe310aa9b74f687854cc5857605993f3d9eb11
946 1 platform\-config b60622856eb7ce52637b80f30a520e6e87c347daa679f3335f4f1a600681bb01
947 2 external\-code 1471262403e9a62f9c392941300b4807fbdb6f0bfdd50abfab752732087017dd
948 3 external\-config 3d458cfe55cc03ea1f443f1562beec8df51c75e14a9fcf9a7234a13f198e7969
949 4 boot\-loader\-code 939f7fa1458e1f7ce968874d908e524fc0debf890383d355e4ce347b7b78a95c
950 5 boot\-loader\-config 864c61c5ea5ecbdb6951e6cb6d9c1f4b4eac79772f7fe13b8bece569d83d3768
951 6 \- 3d458cfe55cc03ea1f443f1562beec8df51c75e14a9fcf9a7234a13f198e7969
952 7 secure\-boot\-policy 9c905bd9b9891bfb889b90a54c4b537b889cfa817c4389cc25754823a9443255
953 8 \- 0000000000000000000000000000000000000000000000000000000000000000
954 9 kernel\-initrd 9caa29b128113ef42aa53d421f03437be57211e5ebafc0fa8b5d4514ee37ff0c
955 10 ima 5ea9e3dab53eb6b483b6ec9e3b2c712bea66bca1b155637841216e0094387400
956 11 kernel\-boot 0000000000000000000000000000000000000000000000000000000000000000
957 12 kernel\-config 627ffa4b405e911902fe1f1a8b0164693b31acab04f805f15bccfe2209c7eace
958 13 sysexts 0000000000000000000000000000000000000000000000000000000000000000
959 14 shim\-policy 0000000000000000000000000000000000000000000000000000000000000000
960 15 system\-identity 0000000000000000000000000000000000000000000000000000000000000000
961 16 debug 0000000000000000000000000000000000000000000000000000000000000000
962 17 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
963 18 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
964 19 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
965 20 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
966 21 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
967 22 \- ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
968 23 application\-support 0000000000000000000000000000000000000000000000000000000000000000
969 .fi
970 .if n \{\
971 .RE
972 .\}
973 .SS "systemd\-analyze srk [>\fIFILE\fR]"
974 .PP
975 This command reads the Storage Root Key (SRK) from the TPM2 device, and writes it in marshalled TPM2B_PUBLIC format to stdout\&. The output is non\-printable data, so it should be redirected to a file or into a pipe\&.
976 .PP
977 \fBExample\ \&27.\ \&Save the Storage Root Key to srk\&.tpm2b_public\fR
978 .sp
979 .if n \{\
980 .RS 4
981 .\}
982 .nf
983 systemd\-analyze srk >srk\&.tpm2b_public
984 .fi
985 .if n \{\
986 .RE
987 .\}
988 .SS "systemd\-analyze architectures [\fINAME\fR\&.\&.\&.]"
989 .PP
990 Lists all known CPU architectures, and which ones are native\&. The listed architecture names are those
991 \fIConditionArchitecture=\fR
992 supports, see
993 \fBsystemd.unit\fR(5)
994 for details\&. If architecture names are specified only those specified are listed\&.
995 .PP
996 \fBExample\ \&28.\ \&Table output\fR
997 .sp
998 .if n \{\
999 .RS 4
1000 .\}
1001 .nf
1002 $ systemd\-analyze architectures
1003 NAME SUPPORT
1004 alpha foreign
1005 arc foreign
1006 arc\-be foreign
1007 arm foreign
1008 arm64 foreign
1009 \&...
1010 sparc foreign
1011 sparc64 foreign
1012 tilegx foreign
1013 x86 secondary
1014 x86\-64 native
1015 .fi
1016 .if n \{\
1017 .RE
1018 .\}
1019 .SS "systemd\-analyze smbios11"
1020 .PP
1021 Shows a list of SMBIOS Type #11 strings passed to the system\&. Also see
1022 \fBsmbios-type-11\fR(7)\&.
1023 .PP
1024 \fBExample\ \&29.\ \&Example output\fR
1025 .sp
1026 .if n \{\
1027 .RS 4
1028 .\}
1029 .nf
1030 $ systemd\-analyze smbios11
1031 io\&.systemd\&.stub\&.kernel\-cmdline\-extra=console=ttyS0
1032 io\&.systemd\&.credential\&.binary:ssh\&.ephemeral\-authorized_keys\-all=c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSURGd20xbFp4WlRGclJteG9ZQlozOTYzcE1uYlJCaDMwM1MxVXhLSUM2NmYgbGVubmFydEB6ZXRhCg==
1033 io\&.systemd\&.credential:vmm\&.notify_socket=vsock\-stream:2:254570042
1034
1035 3 SMBIOS Type #11 strings passed\&.
1036 .fi
1037 .if n \{\
1038 .RE
1039 .\}
1040 .PP
1041 Added in version 257\&.
1042 .SH "OPTIONS"
1043 .PP
1044 The following options are understood:
1045 .PP
1046 \fB\-\-system\fR
1047 .RS 4
1048 Operates on the system systemd instance\&. This is the implied default\&.
1049 .sp
1050 Added in version 209\&.
1051 .RE
1052 .PP
1053 \fB\-\-user\fR
1054 .RS 4
1055 Operates on the user systemd instance\&.
1056 .sp
1057 Added in version 186\&.
1058 .RE
1059 .PP
1060 \fB\-\-global\fR
1061 .RS 4
1062 Operates on the system\-wide configuration for user systemd instance\&.
1063 .sp
1064 Added in version 238\&.
1065 .RE
1066 .PP
1067 \fB\-\-order\fR, \fB\-\-require\fR
1068 .RS 4
1069 When used in conjunction with the
1070 \fBdot\fR
1071 command (see above), selects which dependencies are shown in the dependency graph\&. If
1072 \fB\-\-order\fR
1073 is passed, only dependencies of type
1074 \fIAfter=\fR
1075 or
1076 \fIBefore=\fR
1077 are shown\&. If
1078 \fB\-\-require\fR
1079 is passed, only dependencies of type
1080 \fIRequires=\fR,
1081 \fIRequisite=\fR,
1082 \fIBindsTo=\fR,
1083 \fIWants=\fR, and
1084 \fIConflicts=\fR
1085 are shown\&. If neither is passed, this shows dependencies of all these types\&.
1086 .sp
1087 Added in version 198\&.
1088 .RE
1089 .PP
1090 \fB\-\-from\-pattern=\fR, \fB\-\-to\-pattern=\fR
1091 .RS 4
1092 When used in conjunction with the
1093 \fBdot\fR
1094 command (see above), this selects which relationships are shown in the dependency graph\&. Both options require a
1095 \fBglob\fR(7)
1096 pattern as an argument, which will be matched against the left\-hand and the right\-hand, respectively, nodes of a relationship\&.
1097 .sp
1098 Each of these can be used more than once, in which case the unit name must match one of the values\&. When tests for both sides of the relation are present, a relation must pass both tests to be shown\&. When patterns are also specified as positional arguments, they must match at least one side of the relation\&. In other words, patterns specified with those two options will trim the list of edges matched by the positional arguments, if any are given, and fully determine the list of edges shown otherwise\&.
1099 .sp
1100 Added in version 201\&.
1101 .RE
1102 .PP
1103 \fB\-\-fuzz=\fR\fB\fItimespan\fR\fR
1104 .RS 4
1105 When used in conjunction with the
1106 \fBcritical\-chain\fR
1107 command (see above), also show units, which finished
1108 \fItimespan\fR
1109 earlier, than the latest unit in the same level\&. The unit of
1110 \fItimespan\fR
1111 is seconds unless specified with a different unit, e\&.g\&. "50ms"\&.
1112 .sp
1113 Added in version 203\&.
1114 .RE
1115 .PP
1116 \fB\-\-man=no\fR
1117 .RS 4
1118 Do not invoke
1119 \fBman\fR(1)
1120 to verify the existence of man pages listed in
1121 \fIDocumentation=\fR\&.
1122 .sp
1123 Added in version 235\&.
1124 .RE
1125 .PP
1126 \fB\-\-generators\fR
1127 .RS 4
1128 Invoke unit generators, see
1129 \fBsystemd.generator\fR(7)\&. Some generators require root privileges\&. Under a normal user, running with generators enabled will generally result in some warnings\&.
1130 .sp
1131 Added in version 235\&.
1132 .RE
1133 .PP
1134 \fB\-\-instance=NAME\fR
1135 .RS 4
1136 Specifies fallback instance name for template units\&. This will be used when one or more template units without an instance name (e\&.g\&.
1137 foo@\&.service) specified for
1138 \fBsystemd\-analyze condition\fR
1139 with
1140 \fB\-\-unit=\fR,
1141 \fBsystemd\-analyze security\fR, and
1142 \fBsystemd\-analyze verify\fR\&. If unspecified,
1143 "test_instance"
1144 will be used\&.
1145 .sp
1146 Added in version 257\&.
1147 .RE
1148 .PP
1149 \fB\-\-recursive\-errors=\fR\fB\fIMODE\fR\fR
1150 .RS 4
1151 Control verification of units and their dependencies and whether
1152 \fBsystemd\-analyze verify\fR
1153 exits with a non\-zero process exit status or not\&. With
1154 \fByes\fR, return a non\-zero process exit status when warnings arise during verification of either the specified unit or any of its associated dependencies\&. With
1155 \fBno\fR, return a non\-zero process exit status when warnings arise during verification of only the specified unit\&. With
1156 \fBone\fR, return a non\-zero process exit status when warnings arise during verification of either the specified unit or its immediate dependencies\&. If this option is not specified, zero is returned as the exit status regardless whether warnings arise during verification or not\&.
1157 .sp
1158 Added in version 250\&.
1159 .RE
1160 .PP
1161 \fB\-\-root=\fR\fB\fIPATH\fR\fR
1162 .RS 4
1163 With
1164 \fBcat\-config\fR,
1165 \fBverify\fR,
1166 \fBcondition\fR
1167 and
1168 \fBsecurity\fR
1169 when used with
1170 \fB\-\-offline=\fR, operate on files underneath the specified root path
1171 \fIPATH\fR\&.
1172 .sp
1173 Added in version 239\&.
1174 .RE
1175 .PP
1176 \fB\-\-image=\fR\fB\fIPATH\fR\fR
1177 .RS 4
1178 With
1179 \fBcat\-config\fR,
1180 \fBverify\fR,
1181 \fBcondition\fR
1182 and
1183 \fBsecurity\fR
1184 when used with
1185 \fB\-\-offline=\fR, operate on files inside the specified image path
1186 \fIPATH\fR\&.
1187 .sp
1188 Added in version 250\&.
1189 .RE
1190 .PP
1191 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
1192 .RS 4
1193 Takes an image policy string as argument, as per
1194 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
1195 \fB\-\-image=\fR, see above\&. If not specified, defaults to the
1196 "*"
1197 policy, i\&.e\&. all recognized file systems in the image are used\&.
1198 .RE
1199 .PP
1200 \fB\-\-offline=\fR\fB\fIBOOL\fR\fR
1201 .RS 4
1202 With
1203 \fBsecurity\fR, perform an offline security review of the specified unit files, i\&.e\&. does not have to rely on PID 1 to acquire security information for the files like the
1204 \fBsecurity\fR
1205 verb when used by itself does\&. This means that
1206 \fB\-\-offline=\fR
1207 can be used with
1208 \fB\-\-root=\fR
1209 and
1210 \fB\-\-image=\fR
1211 as well\&. If a unit\*(Aqs overall exposure level is above that set by
1212 \fB\-\-threshold=\fR
1213 (default value is 100),
1214 \fB\-\-offline=\fR
1215 will return an error\&.
1216 .sp
1217 Added in version 250\&.
1218 .RE
1219 .PP
1220 \fB\-\-profile=\fR\fB\fIPATH\fR\fR
1221 .RS 4
1222 With
1223 \fBsecurity\fR
1224 \fB\-\-offline=\fR, takes into consideration the specified portable profile when assessing unit settings\&. The profile can be passed by name, in which case the well\-known system locations will be searched, or it can be the full path to a specific drop\-in file\&.
1225 .sp
1226 Added in version 250\&.
1227 .RE
1228 .PP
1229 \fB\-\-threshold=\fR\fB\fINUMBER\fR\fR
1230 .RS 4
1231 With
1232 \fBsecurity\fR, allow the user to set a custom value to compare the overall exposure level with, for the specified unit files\&. If a unit\*(Aqs overall exposure level, is greater than that set by the user,
1233 \fBsecurity\fR
1234 will return an error\&.
1235 \fB\-\-threshold=\fR
1236 can be used with
1237 \fB\-\-offline=\fR
1238 as well and its default value is 100\&.
1239 .sp
1240 Added in version 250\&.
1241 .RE
1242 .PP
1243 \fB\-\-security\-policy=\fR\fB\fIPATH\fR\fR
1244 .RS 4
1245 With
1246 \fBsecurity\fR, allow the user to define a custom set of requirements formatted as a JSON file against which to compare the specified unit file(s) and determine their overall exposure level to security threats\&.
1247 .sp
1248 .it 1 an-trap
1249 .nr an-no-space-flag 1
1250 .nr an-break-flag 1
1251 .br
1252 .B Table\ \&1.\ \&Accepted Assessment Test Identifiers
1253 .TS
1254 allbox tab(:);
1255 lB.
1256 T{
1257 Assessment Test Identifier
1258 T}
1259 .T&
1260 l
1261 l
1262 l
1263 l
1264 l
1265 l
1266 l
1267 l
1268 l
1269 l
1270 l
1271 l
1272 l
1273 l
1274 l
1275 l
1276 l
1277 l
1278 l
1279 l
1280 l
1281 l
1282 l
1283 l
1284 l
1285 l
1286 l
1287 l
1288 l
1289 l
1290 l
1291 l
1292 l
1293 l
1294 l
1295 l
1296 l
1297 l
1298 l
1299 l
1300 l
1301 l
1302 l
1303 l
1304 l
1305 l
1306 l
1307 l
1308 l
1309 l
1310 l
1311 l
1312 l
1313 l
1314 l
1315 l
1316 l
1317 l
1318 l
1319 l
1320 l
1321 l
1322 l
1323 l
1324 l
1325 l
1326 l
1327 l
1328 l
1329 l
1330 l
1331 l
1332 l
1333 l
1334 l
1335 l
1336 l
1337 l
1338 l
1339 l.
1340 T{
1341 UserOrDynamicUser
1342 T}
1343 T{
1344 SupplementaryGroups
1345 T}
1346 T{
1347 PrivateMounts
1348 T}
1349 T{
1350 PrivateDevices
1351 T}
1352 T{
1353 PrivateTmp
1354 T}
1355 T{
1356 PrivateNetwork
1357 T}
1358 T{
1359 PrivateUsers
1360 T}
1361 T{
1362 ProtectControlGroups
1363 T}
1364 T{
1365 ProtectKernelModules
1366 T}
1367 T{
1368 ProtectKernelTunables
1369 T}
1370 T{
1371 ProtectKernelLogs
1372 T}
1373 T{
1374 ProtectClock
1375 T}
1376 T{
1377 ProtectHome
1378 T}
1379 T{
1380 ProtectHostname
1381 T}
1382 T{
1383 ProtectSystem
1384 T}
1385 T{
1386 RootDirectoryOrRootImage
1387 T}
1388 T{
1389 LockPersonality
1390 T}
1391 T{
1392 MemoryDenyWriteExecute
1393 T}
1394 T{
1395 NoNewPrivileges
1396 T}
1397 T{
1398 CapabilityBoundingSet_CAP_SYS_ADMIN
1399 T}
1400 T{
1401 CapabilityBoundingSet_CAP_SET_UID_GID_PCAP
1402 T}
1403 T{
1404 CapabilityBoundingSet_CAP_SYS_PTRACE
1405 T}
1406 T{
1407 CapabilityBoundingSet_CAP_SYS_TIME
1408 T}
1409 T{
1410 CapabilityBoundingSet_CAP_NET_ADMIN
1411 T}
1412 T{
1413 CapabilityBoundingSet_CAP_SYS_RAWIO
1414 T}
1415 T{
1416 CapabilityBoundingSet_CAP_SYS_MODULE
1417 T}
1418 T{
1419 CapabilityBoundingSet_CAP_AUDIT
1420 T}
1421 T{
1422 CapabilityBoundingSet_CAP_SYSLOG
1423 T}
1424 T{
1425 CapabilityBoundingSet_CAP_SYS_NICE_RESOURCE
1426 T}
1427 T{
1428 CapabilityBoundingSet_CAP_MKNOD
1429 T}
1430 T{
1431 CapabilityBoundingSet_CAP_CHOWN_FSETID_SETFCAP
1432 T}
1433 T{
1434 CapabilityBoundingSet_CAP_DAC_FOWNER_IPC_OWNER
1435 T}
1436 T{
1437 CapabilityBoundingSet_CAP_KILL
1438 T}
1439 T{
1440 CapabilityBoundingSet_CAP_NET_BIND_SERVICE_BROADCAST_RAW
1441 T}
1442 T{
1443 CapabilityBoundingSet_CAP_SYS_BOOT
1444 T}
1445 T{
1446 CapabilityBoundingSet_CAP_MAC
1447 T}
1448 T{
1449 CapabilityBoundingSet_CAP_LINUX_IMMUTABLE
1450 T}
1451 T{
1452 CapabilityBoundingSet_CAP_IPC_LOCK
1453 T}
1454 T{
1455 CapabilityBoundingSet_CAP_SYS_CHROOT
1456 T}
1457 T{
1458 CapabilityBoundingSet_CAP_BLOCK_SUSPEND
1459 T}
1460 T{
1461 CapabilityBoundingSet_CAP_WAKE_ALARM
1462 T}
1463 T{
1464 CapabilityBoundingSet_CAP_LEASE
1465 T}
1466 T{
1467 CapabilityBoundingSet_CAP_SYS_TTY_CONFIG
1468 T}
1469 T{
1470 CapabilityBoundingSet_CAP_BPF
1471 T}
1472 T{
1473 UMask
1474 T}
1475 T{
1476 KeyringMode
1477 T}
1478 T{
1479 ProtectProc
1480 T}
1481 T{
1482 ProcSubset
1483 T}
1484 T{
1485 NotifyAccess
1486 T}
1487 T{
1488 RemoveIPC
1489 T}
1490 T{
1491 Delegate
1492 T}
1493 T{
1494 RestrictRealtime
1495 T}
1496 T{
1497 RestrictSUIDSGID
1498 T}
1499 T{
1500 RestrictNamespaces_user
1501 T}
1502 T{
1503 RestrictNamespaces_mnt
1504 T}
1505 T{
1506 RestrictNamespaces_ipc
1507 T}
1508 T{
1509 RestrictNamespaces_pid
1510 T}
1511 T{
1512 RestrictNamespaces_cgroup
1513 T}
1514 T{
1515 RestrictNamespaces_uts
1516 T}
1517 T{
1518 RestrictNamespaces_net
1519 T}
1520 T{
1521 RestrictAddressFamilies_AF_INET_INET6
1522 T}
1523 T{
1524 RestrictAddressFamilies_AF_UNIX
1525 T}
1526 T{
1527 RestrictAddressFamilies_AF_NETLINK
1528 T}
1529 T{
1530 RestrictAddressFamilies_AF_PACKET
1531 T}
1532 T{
1533 RestrictAddressFamilies_OTHER
1534 T}
1535 T{
1536 SystemCallArchitectures
1537 T}
1538 T{
1539 SystemCallFilter_swap
1540 T}
1541 T{
1542 SystemCallFilter_obsolete
1543 T}
1544 T{
1545 SystemCallFilter_clock
1546 T}
1547 T{
1548 SystemCallFilter_cpu_emulation
1549 T}
1550 T{
1551 SystemCallFilter_debug
1552 T}
1553 T{
1554 SystemCallFilter_mount
1555 T}
1556 T{
1557 SystemCallFilter_module
1558 T}
1559 T{
1560 SystemCallFilter_raw_io
1561 T}
1562 T{
1563 SystemCallFilter_reboot
1564 T}
1565 T{
1566 SystemCallFilter_privileged
1567 T}
1568 T{
1569 SystemCallFilter_resources
1570 T}
1571 T{
1572 IPAddressDeny
1573 T}
1574 T{
1575 DeviceAllow
1576 T}
1577 T{
1578 AmbientCapabilities
1579 T}
1580 .TE
1581 .sp 1
1582 See example "JSON Policy" below\&.
1583 .sp
1584 Added in version 250\&.
1585 .RE
1586 .PP
1587 \fB\-\-json=\fR\fB\fIMODE\fR\fR
1588 .RS 4
1589 With the
1590 \fBsecurity\fR
1591 command, generate a JSON formatted output of the security analysis table\&. The format is a JSON array with objects containing the following fields:
1592 \fIset\fR
1593 which indicates if the setting has been enabled or not,
1594 \fIname\fR
1595 which is what is used to refer to the setting,
1596 \fIjson_field\fR
1597 which is the JSON compatible identifier of the setting,
1598 \fIdescription\fR
1599 which is an outline of the setting state, and
1600 \fIexposure\fR
1601 which is a number in the range 0\&.0\&...10\&.0, where a higher value corresponds to a higher security threat\&. The JSON version of the table is printed to standard output\&. The
1602 \fIMODE\fR
1603 passed to the option can be one of three:
1604 \fBoff\fR
1605 which is the default,
1606 \fBpretty\fR
1607 and
1608 \fBshort\fR
1609 which respectively output a prettified or shorted JSON version of the security table\&. With the
1610 \fBplot\fR
1611 command, generate a JSON formatted output of the raw time data\&. The format is a JSON array with objects containing the following fields:
1612 \fIname\fR
1613 which is the unit name,
1614 \fIactivated\fR
1615 which is the time after startup the service was activated,
1616 \fIactivating\fR
1617 which is how long after startup the service was initially started,
1618 \fItime\fR
1619 which is how long the service took to activate from when it was initially started,
1620 \fIdeactivated\fR
1621 which is the time after startup that the service was deactivated,
1622 \fIdeactivating\fR
1623 which is the time after startup that the service was initially told to deactivate\&.
1624 .sp
1625 Added in version 250\&.
1626 .RE
1627 .PP
1628 \fB\-\-iterations=\fR\fB\fINUMBER\fR\fR
1629 .RS 4
1630 When used with the
1631 \fBcalendar\fR
1632 command, show the specified number of iterations the specified calendar expression will elapse next\&. Defaults to 1\&.
1633 .sp
1634 Added in version 242\&.
1635 .RE
1636 .PP
1637 \fB\-\-base\-time=\fR\fB\fITIMESTAMP\fR\fR
1638 .RS 4
1639 When used with the
1640 \fBcalendar\fR
1641 command, show next iterations relative to the specified point in time\&. If not specified, defaults to the current time\&.
1642 .sp
1643 Added in version 244\&.
1644 .RE
1645 .PP
1646 \fB\-\-unit=\fR\fB\fIUNIT\fR\fR
1647 .RS 4
1648 When used with the
1649 \fBcondition\fR
1650 command, evaluate all the
1651 \fICondition*=\&.\&.\&.\fR
1652 and
1653 \fIAssert*=\&.\&.\&.\fR
1654 assignments in the specified unit file\&. The full unit search path is formed by combining the directories for the specified unit with the usual unit load paths\&. The variable
1655 \fI$SYSTEMD_UNIT_PATH\fR
1656 is supported, and may be used to replace or augment the compiled in set of unit load paths; see
1657 \fBsystemd.unit\fR(5)\&. All units files present in the directory containing the specified unit will be used in preference to the other paths\&. If a template unit without an instance name is specified (e\&.g\&.
1658 foo@\&.service),
1659 "test_instance"
1660 will be used as the instance name, which can be controlled by
1661 \fB\-\-instance=\fR
1662 option\&.
1663 .sp
1664 Added in version 250\&.
1665 .RE
1666 .PP
1667 \fB\-\-table\fR
1668 .RS 4
1669 When used with the
1670 \fBplot\fR
1671 command, the raw time data is output in a table\&.
1672 .sp
1673 Added in version 253\&.
1674 .RE
1675 .PP
1676 \fB\-\-no\-legend\fR
1677 .RS 4
1678 When used with the
1679 \fBplot\fR
1680 command in combination with either
1681 \fB\-\-table\fR
1682 or
1683 \fB\-\-json=\fR, no legends or hints are included in the output\&.
1684 .sp
1685 Added in version 253\&.
1686 .RE
1687 .PP
1688 \fB\-H\fR, \fB\-\-host=\fR
1689 .RS 4
1690 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
1691 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
1692 ":", and then a container name, separated by
1693 "/", 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
1694 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
1695 .RE
1696 .PP
1697 \fB\-M\fR, \fB\-\-machine=\fR
1698 .RS 4
1699 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
1700 "@"
1701 character\&. If the special string
1702 "\&.host"
1703 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:
1704 "\-\-user \-\-machine=lennart@\&.host")\&. If the
1705 "@"
1706 syntax is not used, the connection is made as root user\&. If the
1707 "@"
1708 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
1709 "\&.host"
1710 are implied\&.
1711 .RE
1712 .PP
1713 \fB\-q\fR, \fB\-\-quiet\fR
1714 .RS 4
1715 Suppress hints and other non\-essential output\&.
1716 .sp
1717 Added in version 250\&.
1718 .RE
1719 .PP
1720 \fB\-\-tldr\fR
1721 .RS 4
1722 With
1723 \fBcat\-config\fR, only print the "interesting" parts of the configuration files, skipping comments and empty lines and section headers followed only by comments and empty lines\&.
1724 .sp
1725 Added in version 255\&.
1726 .RE
1727 .PP
1728 \fB\-\-scale\-svg=\fR\fB\fIFACTOR\fR\fR
1729 .RS 4
1730 When used with the
1731 \fBplot\fR
1732 command, the x\-axis of the plot can be stretched by FACTOR (default: 1\&.0)\&.
1733 .sp
1734 Added in version 257\&.
1735 .RE
1736 .PP
1737 \fB\-\-detailed\fR
1738 .RS 4
1739 When used with the
1740 \fBplot\fR
1741 command, activation timestamps details can be seen in SVG plot\&.
1742 .sp
1743 Added in version 257\&.
1744 .RE
1745 .PP
1746 \fB\-h\fR, \fB\-\-help\fR
1747 .RS 4
1748 Print a short help text and exit\&.
1749 .RE
1750 .PP
1751 \fB\-\-version\fR
1752 .RS 4
1753 Print a short version string and exit\&.
1754 .RE
1755 .PP
1756 \fB\-\-no\-pager\fR
1757 .RS 4
1758 Do not pipe output into a pager\&.
1759 .RE
1760 .SH "EXIT STATUS"
1761 .PP
1762 For most verbs,
1763 \fB0\fR
1764 is returned on success, and a non\-zero failure code otherwise\&.
1765 .PP
1766 For the verb
1767 \fBcompare\-versions\fR, in the two\-argument form,
1768 \fB12\fR,
1769 \fB0\fR, or
1770 \fB11\fR
1771 are returned if the second version string is respectively larger than, equal to, or smaller than the first\&. In the three\-argument form,
1772 \fB0\fR
1773 or
1774 \fB1\fR
1775 are returned when the condition is respectively true or false\&.
1776 .PP
1777 For the verb
1778 \fBhas\-tpm2\fR,
1779 \fB0\fR
1780 is returned if a TPM2 device is discovered, supported, and used by firmware, driver, and userspace (i\&.e\&.
1781 \fBsystemd\fR)\&. Otherwise, the OR combination of the value
1782 \fB1\fR
1783 (in case firmware support is missing),
1784 \fB2\fR
1785 (in case driver support is missing), and
1786 \fB4\fR
1787 (in case userspace support is missing)\&. If no TPM2 support is available at all, value
1788 \fB7\fR
1789 is hence returned\&.
1790 .SH "ENVIRONMENT"
1791 .PP
1792 \fI$SYSTEMD_LOG_LEVEL\fR
1793 .RS 4
1794 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)
1795 \fBemerg\fR,
1796 \fBalert\fR,
1797 \fBcrit\fR,
1798 \fBerr\fR,
1799 \fBwarning\fR,
1800 \fBnotice\fR,
1801 \fBinfo\fR,
1802 \fBdebug\fR, or an integer in the range 0\&...7\&. See
1803 \fBsyslog\fR(3)
1804 for more information\&. Each value may optionally be prefixed with one of
1805 \fBconsole\fR,
1806 \fBsyslog\fR,
1807 \fBkmsg\fR
1808 or
1809 \fBjournal\fR
1810 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
1811 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
1812 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\&.
1813 .RE
1814 .PP
1815 \fI$SYSTEMD_LOG_COLOR\fR
1816 .RS 4
1817 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
1818 .sp
1819 This setting is only useful when messages are written directly to the terminal, because
1820 \fBjournalctl\fR(1)
1821 and other tools that display logs will color messages based on the log level on their own\&.
1822 .RE
1823 .PP
1824 \fI$SYSTEMD_LOG_TIME\fR
1825 .RS 4
1826 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
1827 .sp
1828 This setting is only useful when messages are written directly to the terminal or a file, because
1829 \fBjournalctl\fR(1)
1830 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
1831 .RE
1832 .PP
1833 \fI$SYSTEMD_LOG_LOCATION\fR
1834 .RS 4
1835 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
1836 .sp
1837 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\&.
1838 .RE
1839 .PP
1840 \fI$SYSTEMD_LOG_TID\fR
1841 .RS 4
1842 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
1843 .sp
1844 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\&.
1845 .RE
1846 .PP
1847 \fI$SYSTEMD_LOG_TARGET\fR
1848 .RS 4
1849 The destination for log messages\&. One of
1850 \fBconsole\fR
1851 (log to the attached tty),
1852 \fBconsole\-prefixed\fR
1853 (log to the attached tty but with prefixes encoding the log level and "facility", see
1854 \fBsyslog\fR(3),
1855 \fBkmsg\fR
1856 (log to the kernel circular log buffer),
1857 \fBjournal\fR
1858 (log to the journal),
1859 \fBjournal\-or\-kmsg\fR
1860 (log to the journal if available, and to kmsg otherwise),
1861 \fBauto\fR
1862 (determine the appropriate log target automatically, the default),
1863 \fBnull\fR
1864 (disable log output)\&.
1865 .RE
1866 .PP
1867 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
1868 .RS 4
1869 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
1870 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
1871 .RE
1872 .PP
1873 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
1874 .RS 4
1875 Pager to use when
1876 \fB\-\-no\-pager\fR
1877 is not given\&.
1878 \fI$SYSTEMD_PAGER\fR
1879 is used if set; otherwise
1880 \fI$PAGER\fR
1881 is used\&. If neither
1882 \fI$SYSTEMD_PAGER\fR
1883 nor
1884 \fI$PAGER\fR
1885 are set, a set of well\-known pager implementations is tried in turn, including
1886 \fBless\fR(1)
1887 and
1888 \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
1889 "cat"
1890 is equivalent to passing
1891 \fB\-\-no\-pager\fR\&.
1892 .sp
1893 Note: if
1894 \fI$SYSTEMD_PAGERSECURE\fR
1895 is not set,
1896 \fI$SYSTEMD_PAGER\fR
1897 and
1898 \fI$PAGER\fR
1899 can only be used to disable the pager (with
1900 "cat"
1901 or
1902 ""), and are otherwise ignored\&.
1903 .RE
1904 .PP
1905 \fI$SYSTEMD_LESS\fR
1906 .RS 4
1907 Override the options passed to
1908 \fBless\fR
1909 (by default
1910 "FRSXMK")\&.
1911 .sp
1912 Users might want to change two options in particular:
1913 .PP
1914 \fBK\fR
1915 .RS 4
1916 This option instructs the pager to exit immediately when
1917 Ctrl+C
1918 is pressed\&. To allow
1919 \fBless\fR
1920 to handle
1921 Ctrl+C
1922 itself to switch back to the pager command prompt, unset this option\&.
1923 .sp
1924 If the value of
1925 \fI$SYSTEMD_LESS\fR
1926 does not include
1927 "K", and the pager that is invoked is
1928 \fBless\fR,
1929 Ctrl+C
1930 will be ignored by the executable, and needs to be handled by the pager\&.
1931 .RE
1932 .PP
1933 \fBX\fR
1934 .RS 4
1935 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\&.
1936 .RE
1937 .sp
1938 Note that setting the regular
1939 \fI$LESS\fR
1940 environment variable has no effect for
1941 \fBless\fR
1942 invocations by systemd tools\&.
1943 .sp
1944 See
1945 \fBless\fR(1)
1946 for more discussion\&.
1947 .RE
1948 .PP
1949 \fI$SYSTEMD_LESSCHARSET\fR
1950 .RS 4
1951 Override the charset passed to
1952 \fBless\fR
1953 (by default
1954 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
1955 .sp
1956 Note that setting the regular
1957 \fI$LESSCHARSET\fR
1958 environment variable has no effect for
1959 \fBless\fR
1960 invocations by systemd tools\&.
1961 .RE
1962 .PP
1963 \fI$SYSTEMD_PAGERSECURE\fR
1964 .RS 4
1965 Common pager commands like
1966 \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
1967 \fBsudo\fR(8)
1968 or
1969 \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,
1970 \fIif the pager supports that\fR
1971 (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
1972 \fB\-\-no\-pager\fR
1973 or
1974 \fIPAGER=cat\fR
1975 when allowing untrusted users to execute commands with elevated privileges\&.
1976 .sp
1977 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
1978 \fBLESSSECURE=1\fR
1979 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
1980 \fBless\fR(1)
1981 is known to understand this variable and implement "secure mode"\&.
1982 .sp
1983 When set to false, no limitation is placed on the pager\&. Setting
1984 \fISYSTEMD_PAGERSECURE=0\fR
1985 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
1986 .sp
1987 When
1988 \fI$SYSTEMD_PAGERSECURE\fR
1989 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
1990 \fBgeteuid\fR(2)
1991 and
1992 \fBsd_pid_get_owner_uid\fR(3), or when running under
1993 \fBsudo\fR(8)
1994 or similar tools (\fI$SUDO_UID\fR
1995 is set
1996 \&\s-2\u[3]\d\s+2)\&. In those cases,
1997 \fISYSTEMD_PAGERSECURE=1\fR
1998 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
1999 \fI$SYSTEMD_PAGERSECURE\fR
2000 or disable the pager\&.
2001 .sp
2002 Note that if the
2003 \fI$SYSTEMD_PAGER\fR
2004 or
2005 \fI$PAGER\fR
2006 variables are to be honoured, other than to disable the pager,
2007 \fI$SYSTEMD_PAGERSECURE\fR
2008 must be set too\&.
2009 .RE
2010 .PP
2011 \fI$SYSTEMD_COLORS\fR
2012 .RS 4
2013 Takes a boolean argument\&. When true,
2014 \fBsystemd\fR
2015 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:
2016 "16",
2017 "256"
2018 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
2019 \fI$TERM\fR
2020 and what the console is connected to\&.
2021 .RE
2022 .PP
2023 \fI$SYSTEMD_URLIFY\fR
2024 .RS 4
2025 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
2026 \fBsystemd\fR
2027 makes based on
2028 \fI$TERM\fR
2029 and other conditions\&.
2030 .RE
2031 .SH "EXAMPLES"
2032 .PP
2033 \fBExample\ \&30.\ \&JSON Policy\fR
2034 .PP
2035 The JSON file passed as a path parameter to
2036 \fB\-\-security\-policy=\fR
2037 has a top\-level JSON object, with keys being the assessment test identifiers mentioned above\&. The values in the file should be JSON objects with one or more of the following fields:
2038 \fBdescription_na\fR
2039 (string),
2040 \fBdescription_good\fR
2041 (string),
2042 \fBdescription_bad\fR
2043 (string),
2044 \fBweight\fR
2045 (unsigned integer), and
2046 \fBrange\fR
2047 (unsigned integer)\&. If any of these fields corresponding to a specific id of the unit file is missing from the JSON object, the default built\-in field value corresponding to that same id is used for security analysis as default\&. The weight and range fields are used in determining the overall exposure level of the unit files: the value of each setting is assigned a badness score, which is multiplied by the policy weight and divided by the policy range to determine the overall exposure that the setting implies\&. The computed badness is summed across all settings in the unit file, normalized to the 1\&...100 range, and used to determine the overall exposure level of the unit\&. By allowing users to manipulate these fields, the \*(Aqsecurity\*(Aq verb gives them the option to decide for themself which ids are more important and hence should have a greater effect on the exposure level\&. A weight of
2048 "0"
2049 means the setting will not be checked\&.
2050 .sp
2051 .if n \{\
2052 .RS 4
2053 .\}
2054 .nf
2055 {
2056 "PrivateDevices":
2057 {
2058 "description_good": "Service has no access to hardware devices",
2059 "description_bad": "Service potentially has access to hardware devices",
2060 "weight": 1000,
2061 "range": 1
2062 },
2063 "PrivateMounts":
2064 {
2065 "description_good": "Service cannot install system mounts",
2066 "description_bad": "Service may install system mounts",
2067 "weight": 1000,
2068 "range": 1
2069 },
2070 "PrivateNetwork":
2071 {
2072 "description_good": "Service has no access to the host\*(Aqs network",
2073 "description_bad": "Service has access to the host\*(Aqs network",
2074 "weight": 2500,
2075 "range": 1
2076 },
2077 "PrivateTmp":
2078 {
2079 "description_good": "Service has no access to other software\*(Aqs temporary files",
2080 "description_bad": "Service has access to other software\*(Aqs temporary files",
2081 "weight": 1000,
2082 "range": 1
2083 },
2084 "PrivateUsers":
2085 {
2086 "description_good": "Service does not have access to other users",
2087 "description_bad": "Service has access to other users",
2088 "weight": 1000,
2089 "range": 1
2090 }
2091 }
2092 .fi
2093 .if n \{\
2094 .RE
2095 .\}
2096 .SH "SEE ALSO"
2097 .PP
2098 \fBsystemd\fR(1), \fBsystemctl\fR(1)
2099 .SH "NOTES"
2100 .IP " 1." 4
2101 Packaging Metadata
2102 .RS 4
2103 \%https://systemd.io/COREDUMP_PACKAGE_METADATA/
2104 .RE
2105 .IP " 2." 4
2106 Discoverable Partitions Specification
2107 .RS 4
2108 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
2109 .RE
2110 .IP " 3." 4
2111 It is recommended for other tools to set and check
2112 \fI$SUDO_UID\fR
2113 as appropriate, treating it is a common interface.
2114