]>
Commit | Line | Data |
---|---|---|
359deb60 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
0307f791 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> |
359deb60 | 5 | |
21ac6ff1 | 6 | <refentry id="systemd-analyze" |
798d3a52 ZJS |
7 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
8 | ||
9 | <refentryinfo> | |
10 | <title>systemd-analyze</title> | |
11 | <productname>systemd</productname> | |
798d3a52 ZJS |
12 | </refentryinfo> |
13 | ||
14 | <refmeta> | |
15 | <refentrytitle>systemd-analyze</refentrytitle> | |
16 | <manvolnum>1</manvolnum> | |
17 | </refmeta> | |
18 | ||
19 | <refnamediv> | |
20 | <refname>systemd-analyze</refname> | |
889d695d | 21 | <refpurpose>Analyze and debug system manager</refpurpose> |
798d3a52 ZJS |
22 | </refnamediv> |
23 | ||
24 | <refsynopsisdiv> | |
25 | <cmdsynopsis> | |
26 | <command>systemd-analyze</command> | |
27 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
28 | <arg>time</arg> | |
29 | </cmdsynopsis> | |
30 | <cmdsynopsis> | |
31 | <command>systemd-analyze</command> | |
32 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
33 | <arg choice="plain">blame</arg> | |
34 | </cmdsynopsis> | |
35 | <cmdsynopsis> | |
36 | <command>systemd-analyze</command> | |
37 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
38 | <arg choice="plain">critical-chain</arg> | |
39 | <arg choice="opt" rep="repeat"><replaceable>UNIT</replaceable></arg> | |
40 | </cmdsynopsis> | |
41 | <cmdsynopsis> | |
42 | <command>systemd-analyze</command> | |
43 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
44 | <arg choice="plain">plot</arg> | |
45 | <arg choice="opt">> file.svg</arg> | |
46 | </cmdsynopsis> | |
47 | <cmdsynopsis> | |
48 | <command>systemd-analyze</command> | |
49 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
50 | <arg choice="plain">dot</arg> | |
51 | <arg choice="opt" rep="repeat"><replaceable>PATTERN</replaceable></arg> | |
52 | <arg choice="opt">> file.dot</arg> | |
53 | </cmdsynopsis> | |
54 | <cmdsynopsis> | |
55 | <command>systemd-analyze</command> | |
56 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
57 | <arg choice="plain">dump</arg> | |
58 | </cmdsynopsis> | |
854a42fb ZJS |
59 | <cmdsynopsis> |
60 | <command>systemd-analyze</command> | |
61 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
62 | <arg choice="plain">cat-config</arg> | |
971f6ea5 | 63 | <arg choice="plain" rep="repeat"><replaceable>NAME</replaceable>|<replaceable>PATH</replaceable></arg> |
854a42fb | 64 | </cmdsynopsis> |
31a5924e ZJS |
65 | <cmdsynopsis> |
66 | <command>systemd-analyze</command> | |
67 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
68 | <arg choice="plain">unit-paths</arg> | |
69 | </cmdsynopsis> | |
798d3a52 ZJS |
70 | <cmdsynopsis> |
71 | <command>systemd-analyze</command> | |
72 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
90657286 YW |
73 | <arg choice="plain">log-level</arg> |
74 | <arg choice="opt"><replaceable>LEVEL</replaceable></arg> | |
798d3a52 | 75 | </cmdsynopsis> |
213cf5b1 LP |
76 | <cmdsynopsis> |
77 | <command>systemd-analyze</command> | |
78 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
90657286 YW |
79 | <arg choice="plain">log-target</arg> |
80 | <arg choice="opt"><replaceable>TARGET</replaceable></arg> | |
ef5a8cb1 | 81 | </cmdsynopsis> |
869feb33 ZJS |
82 | <cmdsynopsis> |
83 | <command>systemd-analyze</command> | |
84 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
85 | <arg choice="plain">syscall-filter</arg> | |
1eecafb8 | 86 | <arg choice="opt"><replaceable>SET</replaceable>…</arg> |
869feb33 | 87 | </cmdsynopsis> |
798d3a52 ZJS |
88 | <cmdsynopsis> |
89 | <command>systemd-analyze</command> | |
90 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
91 | <arg choice="plain">verify</arg> | |
92 | <arg choice="opt" rep="repeat"><replaceable>FILES</replaceable></arg> | |
93 | </cmdsynopsis> | |
6d86f4bd LP |
94 | <cmdsynopsis> |
95 | <command>systemd-analyze</command> | |
96 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
97 | <arg choice="plain">calendar</arg> | |
98 | <arg choice="plain" rep="repeat"><replaceable>SPECS</replaceable></arg> | |
99 | </cmdsynopsis> | |
889d695d JK |
100 | <cmdsynopsis> |
101 | <command>systemd-analyze</command> | |
102 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
103 | <arg choice="plain">service-watchdogs</arg> | |
90657286 | 104 | <arg choice="opt"><replaceable>BOOL</replaceable></arg> |
889d695d | 105 | </cmdsynopsis> |
3f1c1287 CD |
106 | <cmdsynopsis> |
107 | <command>systemd-analyze</command> | |
108 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
109 | <arg choice="plain">timespan</arg> | |
110 | <arg choice="plain" rep="repeat"><replaceable>SPAN</replaceable></arg> | |
111 | </cmdsynopsis> | |
ee93c1e6 LP |
112 | <cmdsynopsis> |
113 | <command>systemd-analyze</command> | |
114 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
115 | <arg choice="plain">security</arg> | |
116 | <arg choice="plain" rep="repeat"><replaceable>UNIT</replaceable></arg> | |
117 | </cmdsynopsis> | |
798d3a52 ZJS |
118 | </refsynopsisdiv> |
119 | ||
120 | <refsect1> | |
121 | <title>Description</title> | |
122 | ||
123 | <para><command>systemd-analyze</command> may be used to determine | |
124 | system boot-up performance statistics and retrieve other state and | |
125 | tracing information from the system and service manager, and to | |
889d695d JK |
126 | verify the correctness of unit files. It is also used to access |
127 | special functions useful for advanced system manager debugging.</para> | |
798d3a52 ZJS |
128 | |
129 | <para><command>systemd-analyze time</command> prints the time | |
130 | spent in the kernel before userspace has been reached, the time | |
131 | spent in the initial RAM disk (initrd) before normal system | |
132 | userspace has been reached, and the time normal system userspace | |
133 | took to initialize. Note that these measurements simply measure | |
134 | the time passed up to the point where all system services have | |
135 | been spawned, but not necessarily until they fully finished | |
136 | initialization or the disk is idle.</para> | |
137 | ||
138 | <para><command>systemd-analyze blame</command> prints a list of | |
139 | all running units, ordered by the time they took to initialize. | |
140 | This information may be used to optimize boot-up times. Note that | |
141 | the output might be misleading as the initialization of one | |
142 | service might be slow simply because it waits for the | |
d145f88f MK |
143 | initialization of another service to complete. |
144 | Also note: <command>systemd-analyze blame</command> doesn't display | |
145 | results for services with <varname>Type=simple</varname>, | |
146 | because systemd considers such services to be started immediately, | |
147 | hence no measurement of the initialization delays can be done.</para> | |
798d3a52 ZJS |
148 | |
149 | <para><command>systemd-analyze critical-chain | |
1eecafb8 | 150 | [<replaceable>UNIT…</replaceable>]</command> prints a tree of |
798d3a52 ZJS |
151 | the time-critical chain of units (for each of the specified |
152 | <replaceable>UNIT</replaceable>s or for the default target | |
153 | otherwise). The time after the unit is active or started is | |
154 | printed after the "@" character. The time the unit takes to start | |
155 | is printed after the "+" character. Note that the output might be | |
156 | misleading as the initialization of one service might depend on | |
157 | socket activation and because of the parallel execution of | |
158 | units.</para> | |
159 | ||
160 | <para><command>systemd-analyze plot</command> prints an SVG | |
161 | graphic detailing which system services have been started at what | |
162 | time, highlighting the time they spent on initialization.</para> | |
163 | ||
164 | <para><command>systemd-analyze dot</command> generates textual | |
165 | dependency graph description in dot format for further processing | |
166 | with the GraphViz | |
3ba3a79d | 167 | <citerefentry project='die-net'><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
798d3a52 ZJS |
168 | tool. Use a command line like <command>systemd-analyze dot | dot |
169 | -Tsvg > systemd.svg</command> to generate a graphical dependency | |
170 | tree. Unless <option>--order</option> or | |
171 | <option>--require</option> is passed, the generated graph will | |
172 | show both ordering and requirement dependencies. Optional pattern | |
173 | globbing style specifications (e.g. <filename>*.target</filename>) | |
174 | may be given at the end. A unit dependency is included in the | |
175 | graph if any of these patterns match either the origin or | |
176 | destination node.</para> | |
177 | ||
178 | <para><command>systemd-analyze dump</command> outputs a (usually | |
179 | very long) human-readable serialization of the complete server | |
180 | state. Its format is subject to change without notice and should | |
181 | not be parsed by applications.</para> | |
182 | ||
854a42fb ZJS |
183 | <para><command>systemd-analyze cat-config</command> is similar |
184 | to <command>systemctl cat</command>, but operates on config files. | |
185 | It will copy the contents of a config file and any drop-ins to standard | |
186 | output, using the usual systemd set of directories and rules for | |
971f6ea5 ZJS |
187 | precedence. Each argument must be either an absolute path including |
188 | the prefix (such as <filename>/etc/systemd/logind.conf</filename> or | |
189 | <filename>/usr/lib/systemd/logind.conf</filename>), or a name | |
190 | relative to the prefix (such as <filename>systemd/logind.conf</filename>). | |
191 | </para> | |
854a42fb ZJS |
192 | |
193 | <example> | |
194 | <title>Showing logind configuration</title> | |
195 | <programlisting>$ systemd-analyze cat-config systemd/logind.conf | |
196 | # /etc/systemd/logind.conf | |
854a42fb ZJS |
197 | ... |
198 | [Login] | |
199 | NAutoVTs=8 | |
200 | ... | |
201 | ||
202 | # /usr/lib/systemd/logind.conf.d/20-test.conf | |
203 | ... some override from another package | |
204 | ||
205 | # /etc/systemd/logind.conf.d/50-override.conf | |
1b2ad5d9 | 206 | ... some administrator override |
854a42fb ZJS |
207 | </programlisting> |
208 | </example> | |
209 | ||
31a5924e ZJS |
210 | <para><command>systemd-analyze unit-paths</command> outputs a list of all |
211 | directories from which unit files, <filename>.d</filename> overrides, and | |
212 | <filename>.wants</filename>, <filename>.requires</filename> symlinks may be | |
213 | loaded. Combine with <option>--user</option> to retrieve the list for the user | |
214 | manager instance, and <option>--global</option> for the global configuration of | |
215 | user manager instances. Note that this verb prints the list that is compiled into | |
216 | <command>systemd-analyze</command> itself, and does not comunicate with the | |
217 | running manager. Use | |
218 | <programlisting>systemctl [--user] [--global] show -p UnitPath --value</programlisting> | |
219 | to retrieve the actual list that the manager uses, with any empty directories | |
220 | omitted.</para> | |
221 | ||
90657286 YW |
222 | <para><command>systemd-analyze log-level</command> |
223 | prints the current log level of the <command>systemd</command> daemon. | |
224 | If an optional argument <replaceable>LEVEL</replaceable> is provided, then the command changes the current log | |
225 | level of the <command>systemd</command> daemon to <replaceable>LEVEL</replaceable> (accepts the same values as | |
798d3a52 ZJS |
226 | <option>--log-level=</option> described in |
227 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para> | |
228 | ||
90657286 YW |
229 | <para><command>systemd-analyze log-target</command> |
230 | prints the current log target of the <command>systemd</command> daemon. | |
231 | If an optional argument <replaceable>TARGET</replaceable> is provided, then the command changes the current log | |
232 | target of the <command>systemd</command> daemon to <replaceable>TARGET</replaceable> (accepts the same values as | |
b938cb90 | 233 | <option>--log-target=</option>, described in |
2ca2a91c LP |
234 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para> |
235 | ||
1eecafb8 | 236 | <para><command>systemd-analyze syscall-filter <optional><replaceable>SET</replaceable>…</optional></command> |
869feb33 ZJS |
237 | will list system calls contained in the specified system call set <replaceable>SET</replaceable>, |
238 | or all known sets if no sets are specified. Argument <replaceable>SET</replaceable> must include | |
239 | the <literal>@</literal> prefix.</para> | |
240 | ||
d941ea22 ZJS |
241 | <para><command>systemd-analyze verify</command> will load unit files and print |
242 | warnings if any errors are detected. Files specified on the command line will be | |
243 | loaded, but also any other units referenced by them. The full unit search path is | |
244 | formed by combining the directories for all command line arguments, and the usual unit | |
245 | load paths (variable <varname>$SYSTEMD_UNIT_PATH</varname> is supported, and may be | |
246 | used to replace or augment the compiled in set of unit load paths; see | |
247 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
248 | All units files present in the directories containing the command line arguments will | |
249 | be used in preference to the other paths.</para> | |
798d3a52 | 250 | |
f2ccf832 LP |
251 | <para><command>systemd-analyze calendar</command> will parse and normalize repetitive calendar time |
252 | events, and will calculate when they will elapse next. This takes the same input as the | |
253 | <varname>OnCalendar=</varname> setting in | |
254 | <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
255 | following the syntax described in | |
256 | <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>. By | |
257 | default, only the next time the calendar expression will elapse is shown; use | |
258 | <option>--iterations=</option> to show the specified number of next times the expression elapses.</para> | |
6d86f4bd | 259 | |
90657286 YW |
260 | <para><command>systemd-analyze service-watchdogs</command> |
261 | prints the current state of service runtime watchdogs of the <command>systemd</command> daemon. | |
262 | If an optional boolean argument is provided, then globally enables or disables the service | |
889d695d JK |
263 | runtime watchdogs (<option>WatchdogSec=</option>) and emergency actions (e.g. |
264 | <option>OnFailure=</option> or <option>StartLimitAction=</option>); see | |
265 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
266 | The hardware watchdog is not affected by this setting.</para> | |
267 | ||
3f1c1287 CD |
268 | <para><command>systemd-analyze timespan</command> parses a time span and outputs the equivalent value in microseconds, and as a reformatted timespan. |
269 | The time span should adhere to the same syntax documented in <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
270 | Values without associated magnitudes are parsed as seconds.</para> | |
271 | ||
ee93c1e6 LP |
272 | <para><command>systemd-analyze security</command> analyzes the security and sandboxing settings of one or more |
273 | specified service units. If at least one unit name is specified the security settings of the specified service | |
274 | units are inspected and a detailed analysis is shown. If no unit name is specified, all currently loaded, | |
275 | long-running service units are inspected and a terse table with results shown. The command checks for various | |
276 | security-related service settings, assigning each a numeric "exposure level" value, depending on how important a | |
277 | setting is. It then calculates an overall exposure level for the whole unit, which is an estimation in the range | |
278 | 0.0…10.0 indicating how exposed a service is security-wise. High exposure levels indicate very little applied | |
279 | sandboxing. Low exposure levels indicate tight sandboxing and strongest security restrictions. Note that this only | |
280 | analyzes the per-service security features systemd itself implements. This means that any additional security | |
281 | mechanisms applied by the service code itself are not accounted for. The exposure level determined this way should | |
282 | not be misunderstood: a high exposure level neither means that there is no effective sandboxing applied by the | |
283 | service code itself, nor that the service is actually vulnerable to remote or local attacks. High exposure levels | |
284 | do indicate however that most likely the service might benefit from additional settings applied to them. Please | |
285 | note that many of the security and sandboxing settings individually can be circumvented — unless combined with | |
286 | others. For example, if a service retains the privilege to establish or undo mount points many of the sandboxing | |
287 | options can be undone by the service code itself. Due to that is essential that each service uses the most | |
288 | comprehensive and strict sandboxing and security settings possible. The tool will take into account some of these | |
289 | combinations and relationships between the settings, but not all. Also note that the security and sandboxing | |
290 | settings analyzed here only apply to the operations executed by the service code itself. If a service has access to | |
291 | an IPC system (such as D-Bus) it might request operations from other services that are not subject to the same | |
292 | restrictions. Any comprehensive security and sandboxing analysis is hence incomplete if the IPC access policy is | |
293 | not validated too.</para> | |
294 | ||
798d3a52 ZJS |
295 | <para>If no command is passed, <command>systemd-analyze |
296 | time</command> is implied.</para> | |
297 | ||
298 | </refsect1> | |
299 | ||
300 | <refsect1> | |
301 | <title>Options</title> | |
302 | ||
303 | <para>The following options are understood:</para> | |
304 | ||
305 | <variablelist> | |
28b35ef2 ZJS |
306 | <varlistentry> |
307 | <term><option>--system</option></term> | |
308 | ||
309 | <listitem><para>Operates on the system systemd instance. This | |
310 | is the implied default.</para></listitem> | |
311 | </varlistentry> | |
312 | ||
798d3a52 ZJS |
313 | <varlistentry> |
314 | <term><option>--user</option></term> | |
315 | ||
316 | <listitem><para>Operates on the user systemd | |
317 | instance.</para></listitem> | |
318 | </varlistentry> | |
319 | ||
320 | <varlistentry> | |
28b35ef2 | 321 | <term><option>--global</option></term> |
798d3a52 | 322 | |
28b35ef2 ZJS |
323 | <listitem><para>Operates on the system-wide configuration for |
324 | user systemd instance.</para></listitem> | |
798d3a52 ZJS |
325 | </varlistentry> |
326 | ||
327 | <varlistentry> | |
328 | <term><option>--order</option></term> | |
329 | <term><option>--require</option></term> | |
330 | ||
331 | <listitem><para>When used in conjunction with the | |
332 | <command>dot</command> command (see above), selects which | |
333 | dependencies are shown in the dependency graph. If | |
334 | <option>--order</option> is passed, only dependencies of type | |
335 | <varname>After=</varname> or <varname>Before=</varname> are | |
336 | shown. If <option>--require</option> is passed, only | |
337 | dependencies of type <varname>Requires=</varname>, | |
798d3a52 | 338 | <varname>Requisite=</varname>, |
798d3a52 ZJS |
339 | <varname>Wants=</varname> and <varname>Conflicts=</varname> |
340 | are shown. If neither is passed, this shows dependencies of | |
341 | all these types.</para></listitem> | |
342 | </varlistentry> | |
343 | ||
344 | <varlistentry> | |
345 | <term><option>--from-pattern=</option></term> | |
346 | <term><option>--to-pattern=</option></term> | |
347 | ||
348 | <listitem><para>When used in conjunction with the | |
349 | <command>dot</command> command (see above), this selects which | |
6ecb6cec ZJS |
350 | relationships are shown in the dependency graph. Both options |
351 | require a | |
3ba3a79d | 352 | <citerefentry project='die-net'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
6ecb6cec ZJS |
353 | pattern as an argument, which will be matched against the |
354 | left-hand and the right-hand, respectively, nodes of a | |
355 | relationship.</para> | |
356 | ||
357 | <para>Each of these can be used more than once, in which case | |
358 | the unit name must match one of the values. When tests for | |
359 | both sides of the relation are present, a relation must pass | |
360 | both tests to be shown. When patterns are also specified as | |
361 | positional arguments, they must match at least one side of the | |
362 | relation. In other words, patterns specified with those two | |
363 | options will trim the list of edges matched by the positional | |
364 | arguments, if any are given, and fully determine the list of | |
365 | edges shown otherwise.</para></listitem> | |
798d3a52 ZJS |
366 | </varlistentry> |
367 | ||
368 | <varlistentry> | |
369 | <term><option>--fuzz=</option><replaceable>timespan</replaceable></term> | |
370 | ||
371 | <listitem><para>When used in conjunction with the | |
372 | <command>critical-chain</command> command (see above), also | |
373 | show units, which finished <replaceable>timespan</replaceable> | |
374 | earlier, than the latest unit in the same level. The unit of | |
375 | <replaceable>timespan</replaceable> is seconds unless | |
376 | specified with a different unit, e.g. | |
377 | "50ms".</para></listitem> | |
378 | </varlistentry> | |
379 | ||
380 | <varlistentry> | |
641c0fd1 | 381 | <term><option>--man=no</option></term> |
798d3a52 ZJS |
382 | |
383 | <listitem><para>Do not invoke man to verify the existence of | |
6ecb6cec | 384 | man pages listed in <varname>Documentation=</varname>. |
798d3a52 ZJS |
385 | </para></listitem> |
386 | </varlistentry> | |
387 | ||
641c0fd1 ZJS |
388 | <varlistentry> |
389 | <term><option>--generators</option></term> | |
390 | ||
391 | <listitem><para>Invoke unit generators, see | |
392 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
06815764 ZJS |
393 | Some generators require root privileges. Under a normal user, running with |
394 | generators enabled will generally result in some warnings.</para></listitem> | |
641c0fd1 ZJS |
395 | </varlistentry> |
396 | ||
46d8646a ZJS |
397 | <varlistentry> |
398 | <term><option>--root=<replaceable>PATH</replaceable></option></term> | |
399 | ||
400 | <listitem><para>With <command>cat-files</command>, show config files underneath | |
401 | the specified root path <replaceable>PATH</replaceable>.</para></listitem> | |
402 | </varlistentry> | |
403 | ||
f2ccf832 LP |
404 | <varlistentry> |
405 | <term><option>--iterations=<replaceable>NUMBER</replaceable></option></term> | |
406 | ||
407 | <listitem><para>When used with the <command>calendar</command> command, show the specified number of | |
408 | iterations the specified calendar expression will elapse next. Defaults to 1.</para></listitem> | |
409 | </varlistentry> | |
410 | ||
798d3a52 ZJS |
411 | <xi:include href="user-system-options.xml" xpointer="host" /> |
412 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
413 | ||
414 | <xi:include href="standard-options.xml" xpointer="help" /> | |
415 | <xi:include href="standard-options.xml" xpointer="version" /> | |
416 | <xi:include href="standard-options.xml" xpointer="no-pager" /> | |
417 | </variablelist> | |
418 | ||
419 | </refsect1> | |
420 | ||
421 | <refsect1> | |
422 | <title>Exit status</title> | |
423 | ||
424 | <para>On success, 0 is returned, a non-zero failure code | |
425 | otherwise.</para> | |
426 | </refsect1> | |
427 | ||
428 | <refsect1> | |
429 | <title>Examples for <command>dot</command></title> | |
430 | ||
431 | <example> | |
432 | <title>Plots all dependencies of any unit whose name starts with | |
433 | <literal>avahi-daemon</literal></title> | |
434 | ||
435 | <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg | |
1de2a9a5 | 436 | $ eog avahi.svg</programlisting> |
798d3a52 ZJS |
437 | </example> |
438 | ||
439 | <example> | |
440 | <title>Plots the dependencies between all known target units</title> | |
441 | ||
1de2a9a5 | 442 | <programlisting>$ systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg |
816f25e8 | 443 | $ eog targets.svg</programlisting> |
798d3a52 ZJS |
444 | </example> |
445 | </refsect1> | |
816f25e8 | 446 | |
798d3a52 ZJS |
447 | <refsect1> |
448 | <title>Examples for <command>verify</command></title> | |
142c4eca | 449 | |
798d3a52 ZJS |
450 | <para>The following errors are currently detected:</para> |
451 | <itemizedlist> | |
452 | <listitem><para>unknown sections and directives, | |
453 | </para></listitem> | |
142c4eca | 454 | |
798d3a52 | 455 | <listitem><para>missing dependencies which are required to start |
2a03116d | 456 | the given unit,</para></listitem> |
142c4eca | 457 | |
798d3a52 ZJS |
458 | <listitem><para>man pages listed in |
459 | <varname>Documentation=</varname> which are not found in the | |
460 | system,</para></listitem> | |
142c4eca | 461 | |
798d3a52 ZJS |
462 | <listitem><para>commands listed in <varname>ExecStart=</varname> |
463 | and similar which are not found in the system or not | |
464 | executable.</para></listitem> | |
465 | </itemizedlist> | |
142c4eca | 466 | |
798d3a52 ZJS |
467 | <example> |
468 | <title>Misspelt directives</title> | |
142c4eca | 469 | |
798d3a52 | 470 | <programlisting>$ cat ./user.slice |
142c4eca ZJS |
471 | [Unit] |
472 | WhatIsThis=11 | |
473 | Documentation=man:nosuchfile(1) | |
474 | Requires=different.service | |
475 | ||
476 | [Service] | |
301a21a8 | 477 | Description=x |
142c4eca | 478 | |
ee9c4ff4 | 479 | $ systemd-analyze verify ./user.slice |
142c4eca ZJS |
480 | [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit' |
481 | [./user.slice:13] Unknown section 'Service'. Ignoring. | |
482 | Error: org.freedesktop.systemd1.LoadFailed: | |
798d3a52 ZJS |
483 | Unit different.service failed to load: |
484 | No such file or directory. | |
142c4eca ZJS |
485 | Failed to create user.slice/start: Invalid argument |
486 | user.slice: man nosuchfile(1) command failed with code 16 | |
798d3a52 ZJS |
487 | </programlisting> |
488 | </example> | |
142c4eca | 489 | |
798d3a52 ZJS |
490 | <example> |
491 | <title>Missing service units</title> | |
142c4eca | 492 | |
798d3a52 | 493 | <programlisting>$ tail ./a.socket ./b.socket |
142c4eca ZJS |
494 | ==> ./a.socket <== |
495 | [Socket] | |
496 | ListenStream=100 | |
497 | ||
498 | ==> ./b.socket <== | |
499 | [Socket] | |
500 | ListenStream=100 | |
501 | Accept=yes | |
502 | ||
ee9c4ff4 | 503 | $ systemd-analyze verify ./a.socket ./b.socket |
142c4eca ZJS |
504 | Service a.service not loaded, a.socket cannot be started. |
505 | Service b@0.service not loaded, b.socket cannot be started. | |
798d3a52 ZJS |
506 | </programlisting> |
507 | </example> | |
508 | </refsect1> | |
509 | ||
510 | <xi:include href="less-variables.xml" /> | |
511 | ||
512 | <refsect1> | |
513 | <title>See Also</title> | |
514 | <para> | |
515 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
516 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
517 | </para> | |
518 | </refsect1> | |
359deb60 LP |
519 | |
520 | </refentry> |