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

NAME

6       systemd-analyze - Analyze system boot-up performance
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...] set-log-level LEVEL
22
23       systemd-analyze [OPTIONS...] verify [FILES...]
24

DESCRIPTION

26       systemd-analyze may be used to determine system boot-up performance
27       statistics and retrieve other state and tracing information from the
28       system and service manager, and to verify the correctness of unit
29       files.
30
31       systemd-analyze time prints the time spent in the kernel before
32       userspace has been reached, the time spent in the initial RAM disk
33       (initrd) before normal system userspace has been reached, and the time
34       normal system userspace took to initialize. Note that these
35       measurements simply measure the time passed up to the point where all
36       system services have been spawned, but not necessarily until they fully
37       finished initialization or the disk is idle.
38
39       systemd-analyze blame prints a list of all running units, ordered by
40       the time they took to initialize. This information may be used to
41       optimize boot-up times. Note that the output might be misleading as the
42       initialization of one service might be slow simply because it waits for
43       the initialization of another service to complete.
44
45       systemd-analyze critical-chain [UNIT...]  prints a tree of the
46       time-critical chain of units (for each of the specified UNITs or for
47       the default target otherwise). The time after the unit is active or
48       started is printed after the "@" character. The time the unit takes to
49       start is printed after the "+" character. Note that the output might be
50       misleading as the initialization of one service might depend on socket
51       activation and because of the parallel execution of units.
52
53       systemd-analyze plot prints an SVG graphic detailing which system
54       services have been started at what time, highlighting the time they
55       spent on initialization.
56
57       systemd-analyze dot generates textual dependency graph description in
58       dot format for further processing with the GraphViz dot(1) tool. Use a
59       command line like systemd-analyze dot | dot -Tsvg > systemd.svg to
60       generate a graphical dependency tree. Unless --order or --require is
61       passed, the generated graph will show both ordering and requirement
62       dependencies. Optional pattern globbing style specifications (e.g.
63       *.target) may be given at the end. A unit dependency is included in the
64       graph if any of these patterns match either the origin or destination
65       node.
66
67       systemd-analyze dump outputs a (usually very long) human-readable
68       serialization of the complete server state. Its format is subject to
69       change without notice and should not be parsed by applications.
70
71       systemd-analyze set-log-level LEVEL changes the current log level of
72       the systemd daemon to LEVEL (accepts the same values as --log-level=
73       described in systemd(1)).
74
75       systemd-analyze verify will load unit files and print warnings if any
76       errors are detected. Files specified on the command line will be
77       loaded, but also any other units referenced by them. This command works
78       by prepending the directories for all command line arguments at the
79       beginning of the unit load path, which means that all units files found
80       in those directories will be used in preference to the unit files found
81       in the standard locations, even if not listed explicitly.
82
83       If no command is passed, systemd-analyze time is implied.
84

OPTIONS

86       The following options are understood:
87
88       --system
89           Operates on the system systemd instance. This is the implied
90           default.
91
92       --order, --require
93           When used in conjunction with the dot command (see above), selects
94           which dependencies are shown in the dependency graph. If --order is
95           passed, only dependencies of type After= or Before= are shown. If
96           --require is passed, only dependencies of type Requires=,
97           RequiresOverridable=, Requisite=, RequisiteOverridable=, Wants= and
98           Conflicts= are shown. If neither is passed, this shows dependencies
99           of all these types.
100
101       --from-pattern=, --to-pattern=
102           When used in conjunction with the dot command (see above), this
103           selects which relationships are shown in the dependency graph. Both
104           options require a glob(7) pattern as an argument, which will be
105           matched against the left-hand and the right-hand, respectively,
106           nodes of a relationship.
107
108           Each of these can be used more than once, in which case the unit
109           name must match one of the values. When tests for both sides of the
110           relation are present, a relation must pass both tests to be shown.
111           When patterns are also specified as positional arguments, they must
112           match at least one side of the relation. In other words, patterns
113           specified with those two options will trim the list of edges
114           matched by the positional arguments, if any are given, and fully
115           determine the list of edges shown otherwise.
116
117       --fuzz=timespan
118           When used in conjunction with the critical-chain command (see
119           above), also show units, which finished timespan earlier, than the
120           latest unit in the same level. The unit of timespan is seconds
121           unless specified with a different unit, e.g. "50ms".
122
123       --no-man
124           Do not invoke man to verify the existence of man pages listed in
125           Documentation=.
126
127       -H, --host=
128           Execute the operation remotely. Specify a hostname, or a username
129           and hostname separated by "@", to connect to. The hostname may
130           optionally be suffixed by a container name, separated by ":", which
131           connects directly to a specific container on the specified host.
132           This will use SSH to talk to the remote machine manager instance.
133           Container names may be enumerated with machinectl -H HOST.
134
135       -M, --machine=
136           Execute operation on a local container. Specify a container name to
137           connect to.
138
139       -h, --help
140           Print a short help text and exit.
141
142       --version
143           Print a short version string and exit.
144
145       --no-pager
146           Do not pipe output into a pager.
147

EXIT STATUS

149       On success, 0 is returned, a non-zero failure code otherwise.
150

EXAMPLES FOR DOT

152       Example 1. Plots all dependencies of any unit whose name starts with
153       "avahi-daemon"
154
155           $ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
156                 $ eog avahi.svg
157
158       Example 2. Plots the dependencies between all known target units
159
160           systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
161           $ eog targets.svg
162

EXAMPLES FOR VERIFY

164       The following errors are currently detected:
165
166       ·   unknown sections and directives,
167
168       ·   missing dependencies which are required to start the given unit,
169
170       ·   man pages listed in Documentation= which are not found in the
171           system,
172
173       ·   commands listed in ExecStart= and similar which are not found in
174           the system or not executable.
175
176       Example 3. Misspelt directives
177
178           $ cat ./user.slice
179           [Unit]
180           WhatIsThis=11
181           Documentation=man:nosuchfile(1)
182           Requires=different.service
183
184           [Service]
185           Desription=x
186
187           $ systemd-analyze verify ./user.slice
188           [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'
189           [./user.slice:13] Unknown section 'Service'. Ignoring.
190           Error: org.freedesktop.systemd1.LoadFailed:
191              Unit different.service failed to load:
192              No such file or directory.
193           Failed to create user.slice/start: Invalid argument
194           user.slice: man nosuchfile(1) command failed with code 16
195
196
197       Example 4. Missing service units
198
199           $ tail ./a.socket ./b.socket
200           ==> ./a.socket <==
201           [Socket]
202           ListenStream=100
203
204           ==> ./b.socket <==
205           [Socket]
206           ListenStream=100
207           Accept=yes
208
209           $ systemd-analyze verify ./a.socket ./b.socket
210           Service a.service not loaded, a.socket cannot be started.
211           Service b@0.service not loaded, b.socket cannot be started.
212
213

ENVIRONMENT

215       $SYSTEMD_PAGER
216           Pager to use when --no-pager is not given; overrides $PAGER.
217           Setting this to an empty string or the value "cat" is equivalent to
218           passing --no-pager.
219
220       $SYSTEMD_LESS
221           Override the default options passed to less ("FRSXMK").
222

SEE ALSO

224       systemd(1), systemctl(1)
225
226
227
228systemd 219                                                 SYSTEMD-ANALYZE(1)
Impressum