Debian Codegraph @

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

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