1SYSTEMD-ANALYZE(1)              systemd-analyze             SYSTEMD-ANALYZE(1)
2
3
4

NAME

6       systemd-analyze - Analyze and debug system manager
7

SYNOPSIS

9       systemd-analyze [OPTIONS...] [time]
10
11       systemd-analyze [OPTIONS...] blame
12
13       systemd-analyze [OPTIONS...] critical-chain [UNIT...]
14
15       systemd-analyze [OPTIONS...] plot [> file.svg]
16
17       systemd-analyze [OPTIONS...] dot [PATTERN...] [> file.dot]
18
19       systemd-analyze [OPTIONS...] dump
20
21       systemd-analyze [OPTIONS...] cat-config NAME|PATH...
22
23       systemd-analyze [OPTIONS...] unit-paths
24
25       systemd-analyze [OPTIONS...] log-level [LEVEL]
26
27       systemd-analyze [OPTIONS...] log-target [TARGET]
28
29       systemd-analyze [OPTIONS...] syscall-filter [SET...]
30
31       systemd-analyze [OPTIONS...] verify [FILES...]
32
33       systemd-analyze [OPTIONS...] calendar SPECS...
34
35       systemd-analyze [OPTIONS...] service-watchdogs [BOOL]
36

DESCRIPTION

38       systemd-analyze may be used to determine system boot-up performance
39       statistics and retrieve other state and tracing information from the
40       system and service manager, and to verify the correctness of unit
41       files. It is also used to access special functions useful for advanced
42       system manager debugging.
43
44       systemd-analyze time prints the time spent in the kernel before
45       userspace has been reached, the time spent in the initial RAM disk
46       (initrd) before normal system userspace has been reached, and the time
47       normal system userspace took to initialize. Note that these
48       measurements simply measure the time passed up to the point where all
49       system services have been spawned, but not necessarily until they fully
50       finished initialization or the disk is idle.
51
52       systemd-analyze blame prints a list of all running units, ordered by
53       the time they took to initialize. This information may be used to
54       optimize boot-up times. Note that the output might be misleading as the
55       initialization of one service might be slow simply because it waits for
56       the initialization of another service to complete. Also note:
57       systemd-analyze blame doesn't display results for services with
58       Type=simple, because systemd considers such services to be started
59       immediately, hence no measurement of the initialization delays can be
60       done.
61
62       systemd-analyze critical-chain [UNIT...]  prints a tree of the
63       time-critical chain of units (for each of the specified UNITs or for
64       the default target otherwise). The time after the unit is active or
65       started is printed after the "@" character. The time the unit takes to
66       start is printed after the "+" character. Note that the output might be
67       misleading as the initialization of one service might depend on socket
68       activation and because of the parallel execution of units.
69
70       systemd-analyze plot prints an SVG graphic detailing which system
71       services have been started at what time, highlighting the time they
72       spent on initialization.
73
74       systemd-analyze dot generates textual dependency graph description in
75       dot format for further processing with the GraphViz dot(1) tool. Use a
76       command line like systemd-analyze dot | dot -Tsvg > systemd.svg to
77       generate a graphical dependency tree. Unless --order or --require is
78       passed, the generated graph will show both ordering and requirement
79       dependencies. Optional pattern globbing style specifications (e.g.
80       *.target) may be given at the end. A unit dependency is included in the
81       graph if any of these patterns match either the origin or destination
82       node.
83
84       systemd-analyze dump outputs a (usually very long) human-readable
85       serialization of the complete server state. Its format is subject to
86       change without notice and should not be parsed by applications.
87
88       systemd-analyze cat-config is similar to systemctl cat, but operates on
89       config files. It will copy the contents of a config file and any
90       drop-ins to standard output, using the usual systemd set of directories
91       and rules for precedence. Each argument must be either an absolute path
92       including the prefix (such as /etc/systemd/logind.conf or
93       /usr/lib/systemd/logind.conf), or a name relative to the prefix (such
94       as systemd/logind.conf).
95
96       Example 1. Showing logind configuration
97
98           $ systemd-analyze cat-config systemd/logind.conf
99           # /etc/systemd/logind.conf
100           ...
101           [Login]
102           NAutoVTs=8
103           ...
104
105           # /usr/lib/systemd/logind.conf.d/20-test.conf
106           ... some override from another package
107
108           # /etc/systemd/logind.conf.d/50-override.conf
109           ... some administrator override
110
111
112       systemd-analyze unit-paths outputs a list of all directories from which
113       unit files, .d overrides, and .wants, .requires symlinks may be loaded.
114       Combine with --user to retrieve the list for the user manager instance,
115       and --global for the global configuration of user manager instances.
116       Note that this verb prints the list that is compiled into
117       systemd-analyze itself, and does not comunicate with the running
118       manager. Use
119
120           systemctl [--user] [--global] show -p UnitPath --value
121
122       to retrieve the actual list that the manager uses, with any empty
123       directories omitted.
124
125       systemd-analyze log-level prints the current log level of the systemd
126       daemon. If an optional argument LEVEL is provided, then the command
127       changes the current log level of the systemd daemon to LEVEL (accepts
128       the same values as --log-level= described in systemd(1)).
129
130       systemd-analyze log-target prints the current log target of the systemd
131       daemon. If an optional argument TARGET is provided, then the command
132       changes the current log target of the systemd daemon to TARGET (accepts
133       the same values as --log-target=, described in systemd(1)).
134
135       systemd-analyze syscall-filter [SET...]  will list system calls
136       contained in the specified system call set SET, or all known sets if no
137       sets are specified. Argument SET must include the "@" prefix.
138
139       systemd-analyze verify will load unit files and print warnings if any
140       errors are detected. Files specified on the command line will be
141       loaded, but also any other units referenced by them. The full unit
142       search path is formed by combining the directories for all command line
143       arguments, and the usual unit load paths (variable $SYSTEMD_UNIT_PATH
144       is supported, and may be used to replace or augment the compiled in set
145       of unit load paths; see systemd.unit(5)). All units files present in
146       the directories containing the command line arguments will be used in
147       preference to the other paths.
148
149       systemd-analyze calendar will parse and normalize repetitive calendar
150       time events, and will calculate when they will elapse next. This takes
151       the same input as the OnCalendar= setting in systemd.timer(5),
152       following the syntax described in systemd.time(7).
153
154       systemd-analyze service-watchdogs prints the current state of service
155       runtime watchdogs of the systemd daemon. If an optional boolean
156       argument is provided, then globally enables or disables the service
157       runtime watchdogs (WatchdogSec=) and emergency actions (e.g.
158       OnFailure= or StartLimitAction=); see systemd.service(5). The hardware
159       watchdog is not affected by this setting.
160
161       If no command is passed, systemd-analyze time is implied.
162

OPTIONS

164       The following options are understood:
165
166       --system
167           Operates on the system systemd instance. This is the implied
168           default.
169
170       --user
171           Operates on the user systemd instance.
172
173       --global
174           Operates on the system-wide configuration for user systemd
175           instance.
176
177       --order, --require
178           When used in conjunction with the dot command (see above), selects
179           which dependencies are shown in the dependency graph. If --order is
180           passed, only dependencies of type After= or Before= are shown. If
181           --require is passed, only dependencies of type Requires=,
182           Requisite=, Wants= and Conflicts= are shown. If neither is passed,
183           this shows dependencies of all these types.
184
185       --from-pattern=, --to-pattern=
186           When used in conjunction with the dot command (see above), this
187           selects which relationships are shown in the dependency graph. Both
188           options require a glob(7) pattern as an argument, which will be
189           matched against the left-hand and the right-hand, respectively,
190           nodes of a relationship.
191
192           Each of these can be used more than once, in which case the unit
193           name must match one of the values. When tests for both sides of the
194           relation are present, a relation must pass both tests to be shown.
195           When patterns are also specified as positional arguments, they must
196           match at least one side of the relation. In other words, patterns
197           specified with those two options will trim the list of edges
198           matched by the positional arguments, if any are given, and fully
199           determine the list of edges shown otherwise.
200
201       --fuzz=timespan
202           When used in conjunction with the critical-chain command (see
203           above), also show units, which finished timespan earlier, than the
204           latest unit in the same level. The unit of timespan is seconds
205           unless specified with a different unit, e.g. "50ms".
206
207       --man=no
208           Do not invoke man to verify the existence of man pages listed in
209           Documentation=.
210
211       --generators
212           Invoke unit generators, see systemd.generator(7). Some generators
213           require root privileges. Under a normal user, running with
214           generators enabled will generally result in some warnings.
215
216       --root=PATH
217           With cat-files, show config files underneath the specified root
218           path PATH.
219
220       -H, --host=
221           Execute the operation remotely. Specify a hostname, or a username
222           and hostname separated by "@", to connect to. The hostname may
223           optionally be suffixed by a container name, separated by ":", which
224           connects directly to a specific container on the specified host.
225           This will use SSH to talk to the remote machine manager instance.
226           Container names may be enumerated with machinectl -H HOST.
227
228       -M, --machine=
229           Execute operation on a local container. Specify a container name to
230           connect to.
231
232       -h, --help
233           Print a short help text and exit.
234
235       --version
236           Print a short version string and exit.
237
238       --no-pager
239           Do not pipe output into a pager.
240

EXIT STATUS

242       On success, 0 is returned, a non-zero failure code otherwise.
243

EXAMPLES FOR DOT

245       Example 2. Plots all dependencies of any unit whose name starts with
246       "avahi-daemon"
247
248           $ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
249           $ eog avahi.svg
250
251       Example 3. Plots the dependencies between all known target units
252
253           $ systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
254           $ eog targets.svg
255

EXAMPLES FOR VERIFY

257       The following errors are currently detected:
258
259       ·   unknown sections and directives,
260
261       ·   missing dependencies which are required to start the given unit,
262
263       ·   man pages listed in Documentation= which are not found in the
264           system,
265
266       ·   commands listed in ExecStart= and similar which are not found in
267           the system or not executable.
268
269       Example 4. Misspelt directives
270
271           $ cat ./user.slice
272           [Unit]
273           WhatIsThis=11
274           Documentation=man:nosuchfile(1)
275           Requires=different.service
276
277           [Service]
278           Description=x
279
280           $ systemd-analyze verify ./user.slice
281           [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'
282           [./user.slice:13] Unknown section 'Service'. Ignoring.
283           Error: org.freedesktop.systemd1.LoadFailed:
284              Unit different.service failed to load:
285              No such file or directory.
286           Failed to create user.slice/start: Invalid argument
287           user.slice: man nosuchfile(1) command failed with code 16
288
289
290       Example 5. Missing service units
291
292           $ tail ./a.socket ./b.socket
293           ==> ./a.socket <==
294           [Socket]
295           ListenStream=100
296
297           ==> ./b.socket <==
298           [Socket]
299           ListenStream=100
300           Accept=yes
301
302           $ systemd-analyze verify ./a.socket ./b.socket
303           Service a.service not loaded, a.socket cannot be started.
304           Service b@0.service not loaded, b.socket cannot be started.
305
306

ENVIRONMENT

308       $SYSTEMD_PAGER
309           Pager to use when --no-pager is not given; overrides $PAGER. If
310           neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known
311           pager implementations are tried in turn, including less(1) and
312           more(1), until one is found. If no pager implementation is
313           discovered no pager is invoked. Setting this environment variable
314           to an empty string or the value "cat" is equivalent to passing
315           --no-pager.
316
317       $SYSTEMD_LESS
318           Override the options passed to less (by default "FRSXMK").
319
320       $SYSTEMD_LESSCHARSET
321           Override the charset passed to less (by default "utf-8", if the
322           invoking terminal is determined to be UTF-8 compatible).
323

SEE ALSO

325       systemd(1), systemctl(1)
326
327
328
329systemd 239                                                 SYSTEMD-ANALYZE(1)
Impressum