]> git.proxmox.com Git - systemd.git/blame - man/systemd-analyze.1
Imported Upstream version 220
[systemd.git] / man / systemd-analyze.1
CommitLineData
14228c0d 1'\" t
e3bff60a 2.TH "SYSTEMD\-ANALYZE" "1" "" "systemd 220" "systemd-analyze"
14228c0d
MB
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"
23systemd-analyze \- Analyze system boot\-up performance
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...] plot [>\ file\&.svg]
33.HP \w'\fBsystemd\-analyze\fR\ 'u
34\fBsystemd\-analyze\fR [OPTIONS...] dot [\fIPATTERN\fR...] [>\ file\&.dot]
35.HP \w'\fBsystemd\-analyze\fR\ 'u
36\fBsystemd\-analyze\fR [OPTIONS...] dump
37.HP \w'\fBsystemd\-analyze\fR\ 'u
38\fBsystemd\-analyze\fR [OPTIONS...] set\-log\-level [\fILEVEL\fR]
5eef597e
MP
39.HP \w'\fBsystemd\-analyze\fR\ 'u
40\fBsystemd\-analyze\fR [OPTIONS...] verify [\fIFILES\fR...]
14228c0d
MB
41.SH "DESCRIPTION"
42.PP
43\fBsystemd\-analyze\fR
5eef597e 44may 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\&.
14228c0d
MB
45.PP
46\fBsystemd\-analyze time\fR
47prints the time spent in the kernel before userspace has been reached, the time spent in the initial RAM disk (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\&.
48.PP
49\fBsystemd\-analyze blame\fR
50prints 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\&.
51.PP
52\fBsystemd\-analyze critical\-chain [\fR\fB\fIUNIT\&.\&.\&.\fR\fR\fB]\fR
53prints a tree of the time\-critical chain of units (for each of the specified
54\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 one service might depend on socket activation and because of the parallel execution of units\&.
55.PP
56\fBsystemd\-analyze plot\fR
57prints an SVG graphic detailing which system services have been started at what time, highlighting the time they spent on initialization\&.
58.PP
59\fBsystemd\-analyze dot\fR
60generates textual dependency graph description in dot format for further processing with the GraphViz
61\fBdot\fR(1)
62tool\&. Use a command line like
63\fBsystemd\-analyze dot | dot \-Tsvg > systemd\&.svg\fR
64to generate a graphical dependency tree\&. Unless
65\fB\-\-order\fR
66or
67\fB\-\-require\fR
68is passed, the generated graph will show both ordering and requirement dependencies\&. Optional pattern globbing style specifications (e\&.g\&.
69*\&.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\&.
70.PP
71\fBsystemd\-analyze dump\fR
72outputs a (usually very long) human\-readable serialization of the complete server state\&. Its format is subject to change without notice and should not be parsed by applications\&.
73.PP
74\fBsystemd\-analyze set\-log\-level \fR\fB\fILEVEL\fR\fR
75changes the current log level of the
76\fBsystemd\fR
77daemon to
78\fILEVEL\fR
79(accepts the same values as
80\fB\-\-log\-level=\fR
81described in
82\fBsystemd\fR(1))\&.
83.PP
5eef597e
MP
84\fBsystemd\-analyze verify\fR
85will 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\&. This command works by prepending the directories for all command line arguments at the beginning of the unit load path, which means that all units files found in those directories will be used in preference to the unit files found in the standard locations, even if not listed explicitly\&.
86.PP
14228c0d
MB
87If no command is passed,
88\fBsystemd\-analyze time\fR
89is implied\&.
90.SH "OPTIONS"
91.PP
92The following options are understood:
93.PP
60f067b4 94\fB\-\-user\fR
14228c0d 95.RS 4
5eef597e 96Operates on the user systemd instance\&.
14228c0d
MB
97.RE
98.PP
60f067b4 99\fB\-\-system\fR
14228c0d 100.RS 4
5eef597e 101Operates on the system systemd instance\&. This is the implied default\&.
14228c0d
MB
102.RE
103.PP
104\fB\-\-order\fR, \fB\-\-require\fR
105.RS 4
106When used in conjunction with the
107\fBdot\fR
108command (see above), selects which dependencies are shown in the dependency graph\&. If
109\fB\-\-order\fR
110is passed, only dependencies of type
111\fIAfter=\fR
112or
113\fIBefore=\fR
114are shown\&. If
115\fB\-\-require\fR
116is passed, only dependencies of type
117\fIRequires=\fR,
118\fIRequiresOverridable=\fR,
119\fIRequisite=\fR,
120\fIRequisiteOverridable=\fR,
121\fIWants=\fR
122and
123\fIConflicts=\fR
124are shown\&. If neither is passed, this shows dependencies of all these types\&.
125.RE
126.PP
127\fB\-\-from\-pattern=\fR, \fB\-\-to\-pattern=\fR
128.RS 4
129When used in conjunction with the
130\fBdot\fR
e735f4d4 131command (see above), this selects which relationships are shown in the dependency graph\&. Both options require a
14228c0d 132\fBglob\fR(7)
e735f4d4
MP
133pattern as an argument, which will be matched against the left\-hand and the right\-hand, respectively, nodes of a relationship\&.
134.sp
135Each 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\&.
14228c0d
MB
136.RE
137.PP
138\fB\-\-fuzz=\fR\fItimespan\fR
139.RS 4
140When used in conjunction with the
141\fBcritical\-chain\fR
142command (see above), also show units, which finished
143\fItimespan\fR
144earlier, than the latest unit in the same level\&. The unit of
145\fItimespan\fR
146is seconds unless specified with a different unit, e\&.g\&. "50ms"\&.
147.RE
148.PP
5eef597e
MP
149\fB\-\-no\-man\fR
150.RS 4
e735f4d4 151Do not invoke man to verify the existence of man pages listed in
5eef597e
MP
152\fIDocumentation=\fR\&.
153.RE
154.PP
60f067b4
JS
155\fB\-H\fR, \fB\-\-host=\fR
156.RS 4
e842803a
MB
157Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
158"@", to connect to\&. The hostname may optionally be suffixed by a container name, separated by
159":", 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
160\fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&.
60f067b4
JS
161.RE
162.PP
163\fB\-M\fR, \fB\-\-machine=\fR
164.RS 4
165Execute operation on a local container\&. Specify a container name to connect to\&.
166.RE
167.PP
168\fB\-h\fR, \fB\-\-help\fR
169.RS 4
170Print a short help text and exit\&.
171.RE
172.PP
173\fB\-\-version\fR
174.RS 4
175Print a short version string and exit\&.
176.RE
177.PP
14228c0d
MB
178\fB\-\-no\-pager\fR
179.RS 4
180Do not pipe output into a pager\&.
181.RE
182.SH "EXIT STATUS"
183.PP
60f067b4 184On success, 0 is returned, a non\-zero failure code otherwise\&.
5eef597e 185.SH "EXAMPLES FOR DOT"
14228c0d 186.PP
5eef597e 187\fBExample\ \&1.\ \&Plots all dependencies of any unit whose name starts with "avahi\-daemon"\fR
14228c0d
MB
188.sp
189.if n \{\
190.RS 4
191.\}
192.nf
193$ systemd\-analyze dot \*(Aqavahi\-daemon\&.*\*(Aq | dot \-Tsvg > avahi\&.svg
e735f4d4 194 $ eog avahi\&.svg
14228c0d
MB
195.fi
196.if n \{\
197.RE
198.\}
199.PP
5eef597e 200\fBExample\ \&2.\ \&Plots the dependencies between all known target units\fR
14228c0d
MB
201.sp
202.if n \{\
203.RS 4
204.\}
205.nf
206systemd\-analyze dot \-\-to\-pattern=\*(Aq*\&.target\*(Aq \-\-from\-pattern=\*(Aq*\&.target\*(Aq | dot \-Tsvg > targets\&.svg
207$ eog targets\&.svg
5eef597e
MP
208.fi
209.if n \{\
210.RE
211.\}
212.SH "EXAMPLES FOR VERIFY"
213.PP
214The following errors are currently detected:
215.sp
216.RS 4
217.ie n \{\
218\h'-04'\(bu\h'+03'\c
219.\}
220.el \{\
221.sp -1
222.IP \(bu 2.3
223.\}
224unknown sections and directives,
225.RE
226.sp
227.RS 4
228.ie n \{\
229\h'-04'\(bu\h'+03'\c
230.\}
231.el \{\
232.sp -1
233.IP \(bu 2.3
234.\}
235missing dependencies which are required to start the given unit,
236.RE
237.sp
238.RS 4
239.ie n \{\
240\h'-04'\(bu\h'+03'\c
241.\}
242.el \{\
243.sp -1
244.IP \(bu 2.3
245.\}
246man pages listed in
247\fIDocumentation=\fR
248which are not found in the system,
249.RE
250.sp
251.RS 4
252.ie n \{\
253\h'-04'\(bu\h'+03'\c
254.\}
255.el \{\
256.sp -1
257.IP \(bu 2.3
258.\}
259commands listed in
260\fIExecStart=\fR
261and similar which are not found in the system or not executable\&.
262.RE
263.PP
264\fBExample\ \&3.\ \&Misspelt directives\fR
265.sp
266.if n \{\
267.RS 4
268.\}
269.nf
270$ cat \&./user\&.slice
271[Unit]
272WhatIsThis=11
273Documentation=man:nosuchfile(1)
274Requires=different\&.service
275
276[Service]
277Desription=x
278
e735f4d4 279$ systemd\-analyze verify \&./user\&.slice
5eef597e
MP
280[\&./user\&.slice:9] Unknown lvalue \*(AqWhatIsThis\*(Aq in section \*(AqUnit\*(Aq
281[\&./user\&.slice:13] Unknown section \*(AqService\*(Aq\&. Ignoring\&.
282Error: org\&.freedesktop\&.systemd1\&.LoadFailed:
e735f4d4
MP
283 Unit different\&.service failed to load:
284 No such file or directory\&.
5eef597e
MP
285Failed to create user\&.slice/start: Invalid argument
286user\&.slice: man nosuchfile(1) command failed with code 16
e735f4d4 287
5eef597e
MP
288.fi
289.if n \{\
290.RE
291.\}
292.PP
293\fBExample\ \&4.\ \&Missing service units\fR
294.sp
295.if n \{\
296.RS 4
297.\}
298.nf
299$ tail \&./a\&.socket \&./b\&.socket
300==> \&./a\&.socket <==
301[Socket]
302ListenStream=100
303
304==> \&./b\&.socket <==
305[Socket]
306ListenStream=100
307Accept=yes
308
e735f4d4 309$ systemd\-analyze verify \&./a\&.socket \&./b\&.socket
5eef597e
MP
310Service a\&.service not loaded, a\&.socket cannot be started\&.
311Service b@0\&.service not loaded, b\&.socket cannot be started\&.
e735f4d4 312
14228c0d
MB
313.fi
314.if n \{\
315.RE
316.\}
317.SH "ENVIRONMENT"
318.PP
319\fI$SYSTEMD_PAGER\fR
320.RS 4
321Pager to use when
322\fB\-\-no\-pager\fR
323is not given; overrides
324\fI$PAGER\fR\&. Setting this to an empty string or the value
325"cat"
326is equivalent to passing
327\fB\-\-no\-pager\fR\&.
328.RE
60f067b4
JS
329.PP
330\fI$SYSTEMD_LESS\fR
331.RS 4
332Override the default options passed to
333\fBless\fR
334("FRSXMK")\&.
335.RE
14228c0d
MB
336.SH "SEE ALSO"
337.PP
338\fBsystemd\fR(1),
339\fBsystemctl\fR(1)