]>
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"> |
359deb60 LP |
4 | |
5 | <!-- | |
572eb058 | 6 | SPDX-License-Identifier: LGPL-2.1+ |
359deb60 LP |
7 | --> |
8 | ||
21ac6ff1 | 9 | <refentry id="systemd-analyze" |
798d3a52 ZJS |
10 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
11 | ||
12 | <refentryinfo> | |
13 | <title>systemd-analyze</title> | |
14 | <productname>systemd</productname> | |
798d3a52 ZJS |
15 | </refentryinfo> |
16 | ||
17 | <refmeta> | |
18 | <refentrytitle>systemd-analyze</refentrytitle> | |
19 | <manvolnum>1</manvolnum> | |
20 | </refmeta> | |
21 | ||
22 | <refnamediv> | |
23 | <refname>systemd-analyze</refname> | |
889d695d | 24 | <refpurpose>Analyze and debug system manager</refpurpose> |
798d3a52 ZJS |
25 | </refnamediv> |
26 | ||
27 | <refsynopsisdiv> | |
28 | <cmdsynopsis> | |
29 | <command>systemd-analyze</command> | |
30 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
31 | <arg>time</arg> | |
32 | </cmdsynopsis> | |
33 | <cmdsynopsis> | |
34 | <command>systemd-analyze</command> | |
35 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
36 | <arg choice="plain">blame</arg> | |
37 | </cmdsynopsis> | |
38 | <cmdsynopsis> | |
39 | <command>systemd-analyze</command> | |
40 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
41 | <arg choice="plain">critical-chain</arg> | |
42 | <arg choice="opt" rep="repeat"><replaceable>UNIT</replaceable></arg> | |
43 | </cmdsynopsis> | |
44 | <cmdsynopsis> | |
45 | <command>systemd-analyze</command> | |
46 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
47 | <arg choice="plain">plot</arg> | |
48 | <arg choice="opt">> file.svg</arg> | |
49 | </cmdsynopsis> | |
50 | <cmdsynopsis> | |
51 | <command>systemd-analyze</command> | |
52 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
53 | <arg choice="plain">dot</arg> | |
54 | <arg choice="opt" rep="repeat"><replaceable>PATTERN</replaceable></arg> | |
55 | <arg choice="opt">> file.dot</arg> | |
56 | </cmdsynopsis> | |
57 | <cmdsynopsis> | |
58 | <command>systemd-analyze</command> | |
59 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
60 | <arg choice="plain">dump</arg> | |
61 | </cmdsynopsis> | |
854a42fb ZJS |
62 | <cmdsynopsis> |
63 | <command>systemd-analyze</command> | |
64 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
65 | <arg choice="plain">cat-config</arg> | |
971f6ea5 | 66 | <arg choice="plain" rep="repeat"><replaceable>NAME</replaceable>|<replaceable>PATH</replaceable></arg> |
854a42fb | 67 | </cmdsynopsis> |
31a5924e ZJS |
68 | <cmdsynopsis> |
69 | <command>systemd-analyze</command> | |
70 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
71 | <arg choice="plain">unit-paths</arg> | |
72 | </cmdsynopsis> | |
798d3a52 ZJS |
73 | <cmdsynopsis> |
74 | <command>systemd-analyze</command> | |
75 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
90657286 YW |
76 | <arg choice="plain">log-level</arg> |
77 | <arg choice="opt"><replaceable>LEVEL</replaceable></arg> | |
798d3a52 | 78 | </cmdsynopsis> |
213cf5b1 LP |
79 | <cmdsynopsis> |
80 | <command>systemd-analyze</command> | |
81 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
90657286 YW |
82 | <arg choice="plain">log-target</arg> |
83 | <arg choice="opt"><replaceable>TARGET</replaceable></arg> | |
ef5a8cb1 | 84 | </cmdsynopsis> |
869feb33 ZJS |
85 | <cmdsynopsis> |
86 | <command>systemd-analyze</command> | |
87 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
88 | <arg choice="plain">syscall-filter</arg> | |
1eecafb8 | 89 | <arg choice="opt"><replaceable>SET</replaceable>…</arg> |
869feb33 | 90 | </cmdsynopsis> |
798d3a52 ZJS |
91 | <cmdsynopsis> |
92 | <command>systemd-analyze</command> | |
93 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
94 | <arg choice="plain">verify</arg> | |
95 | <arg choice="opt" rep="repeat"><replaceable>FILES</replaceable></arg> | |
96 | </cmdsynopsis> | |
6d86f4bd LP |
97 | <cmdsynopsis> |
98 | <command>systemd-analyze</command> | |
99 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
100 | <arg choice="plain">calendar</arg> | |
101 | <arg choice="plain" rep="repeat"><replaceable>SPECS</replaceable></arg> | |
102 | </cmdsynopsis> | |
889d695d JK |
103 | <cmdsynopsis> |
104 | <command>systemd-analyze</command> | |
105 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
106 | <arg choice="plain">service-watchdogs</arg> | |
90657286 | 107 | <arg choice="opt"><replaceable>BOOL</replaceable></arg> |
889d695d | 108 | </cmdsynopsis> |
3f1c1287 CD |
109 | <cmdsynopsis> |
110 | <command>systemd-analyze</command> | |
111 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
112 | <arg choice="plain">timespan</arg> | |
113 | <arg choice="plain" rep="repeat"><replaceable>SPAN</replaceable></arg> | |
114 | </cmdsynopsis> | |
ee93c1e6 LP |
115 | <cmdsynopsis> |
116 | <command>systemd-analyze</command> | |
117 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
118 | <arg choice="plain">security</arg> | |
119 | <arg choice="plain" rep="repeat"><replaceable>UNIT</replaceable></arg> | |
120 | </cmdsynopsis> | |
798d3a52 ZJS |
121 | </refsynopsisdiv> |
122 | ||
123 | <refsect1> | |
124 | <title>Description</title> | |
125 | ||
126 | <para><command>systemd-analyze</command> may be used to determine | |
127 | system boot-up performance statistics and retrieve other state and | |
128 | tracing information from the system and service manager, and to | |
889d695d JK |
129 | verify the correctness of unit files. It is also used to access |
130 | special functions useful for advanced system manager debugging.</para> | |
798d3a52 ZJS |
131 | |
132 | <para><command>systemd-analyze time</command> prints the time | |
133 | spent in the kernel before userspace has been reached, the time | |
134 | spent in the initial RAM disk (initrd) before normal system | |
135 | userspace has been reached, and the time normal system userspace | |
136 | took to initialize. Note that these measurements simply measure | |
137 | the time passed up to the point where all system services have | |
138 | been spawned, but not necessarily until they fully finished | |
139 | initialization or the disk is idle.</para> | |
140 | ||
141 | <para><command>systemd-analyze blame</command> prints a list of | |
142 | all running units, ordered by the time they took to initialize. | |
143 | This information may be used to optimize boot-up times. Note that | |
144 | the output might be misleading as the initialization of one | |
145 | service might be slow simply because it waits for the | |
d145f88f MK |
146 | initialization of another service to complete. |
147 | Also note: <command>systemd-analyze blame</command> doesn't display | |
148 | results for services with <varname>Type=simple</varname>, | |
149 | because systemd considers such services to be started immediately, | |
150 | hence no measurement of the initialization delays can be done.</para> | |
798d3a52 ZJS |
151 | |
152 | <para><command>systemd-analyze critical-chain | |
1eecafb8 | 153 | [<replaceable>UNIT…</replaceable>]</command> prints a tree of |
798d3a52 ZJS |
154 | the time-critical chain of units (for each of the specified |
155 | <replaceable>UNIT</replaceable>s or for the default target | |
156 | otherwise). The time after the unit is active or started is | |
157 | printed after the "@" character. The time the unit takes to start | |
158 | is printed after the "+" character. Note that the output might be | |
159 | misleading as the initialization of one service might depend on | |
160 | socket activation and because of the parallel execution of | |
161 | units.</para> | |
162 | ||
163 | <para><command>systemd-analyze plot</command> prints an SVG | |
164 | graphic detailing which system services have been started at what | |
165 | time, highlighting the time they spent on initialization.</para> | |
166 | ||
167 | <para><command>systemd-analyze dot</command> generates textual | |
168 | dependency graph description in dot format for further processing | |
169 | with the GraphViz | |
3ba3a79d | 170 | <citerefentry project='die-net'><refentrytitle>dot</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
798d3a52 ZJS |
171 | tool. Use a command line like <command>systemd-analyze dot | dot |
172 | -Tsvg > systemd.svg</command> to generate a graphical dependency | |
173 | tree. Unless <option>--order</option> or | |
174 | <option>--require</option> is passed, the generated graph will | |
175 | show both ordering and requirement dependencies. Optional pattern | |
176 | globbing style specifications (e.g. <filename>*.target</filename>) | |
177 | may be given at the end. A unit dependency is included in the | |
178 | graph if any of these patterns match either the origin or | |
179 | destination node.</para> | |
180 | ||
181 | <para><command>systemd-analyze dump</command> outputs a (usually | |
182 | very long) human-readable serialization of the complete server | |
183 | state. Its format is subject to change without notice and should | |
184 | not be parsed by applications.</para> | |
185 | ||
854a42fb ZJS |
186 | <para><command>systemd-analyze cat-config</command> is similar |
187 | to <command>systemctl cat</command>, but operates on config files. | |
188 | It will copy the contents of a config file and any drop-ins to standard | |
189 | output, using the usual systemd set of directories and rules for | |
971f6ea5 ZJS |
190 | precedence. Each argument must be either an absolute path including |
191 | the prefix (such as <filename>/etc/systemd/logind.conf</filename> or | |
192 | <filename>/usr/lib/systemd/logind.conf</filename>), or a name | |
193 | relative to the prefix (such as <filename>systemd/logind.conf</filename>). | |
194 | </para> | |
854a42fb ZJS |
195 | |
196 | <example> | |
197 | <title>Showing logind configuration</title> | |
198 | <programlisting>$ systemd-analyze cat-config systemd/logind.conf | |
199 | # /etc/systemd/logind.conf | |
854a42fb ZJS |
200 | ... |
201 | [Login] | |
202 | NAutoVTs=8 | |
203 | ... | |
204 | ||
205 | # /usr/lib/systemd/logind.conf.d/20-test.conf | |
206 | ... some override from another package | |
207 | ||
208 | # /etc/systemd/logind.conf.d/50-override.conf | |
1b2ad5d9 | 209 | ... some administrator override |
854a42fb ZJS |
210 | </programlisting> |
211 | </example> | |
212 | ||
31a5924e ZJS |
213 | <para><command>systemd-analyze unit-paths</command> outputs a list of all |
214 | directories from which unit files, <filename>.d</filename> overrides, and | |
215 | <filename>.wants</filename>, <filename>.requires</filename> symlinks may be | |
216 | loaded. Combine with <option>--user</option> to retrieve the list for the user | |
217 | manager instance, and <option>--global</option> for the global configuration of | |
218 | user manager instances. Note that this verb prints the list that is compiled into | |
219 | <command>systemd-analyze</command> itself, and does not comunicate with the | |
220 | running manager. Use | |
221 | <programlisting>systemctl [--user] [--global] show -p UnitPath --value</programlisting> | |
222 | to retrieve the actual list that the manager uses, with any empty directories | |
223 | omitted.</para> | |
224 | ||
90657286 YW |
225 | <para><command>systemd-analyze log-level</command> |
226 | prints the current log level of the <command>systemd</command> daemon. | |
227 | If an optional argument <replaceable>LEVEL</replaceable> is provided, then the command changes the current log | |
228 | level of the <command>systemd</command> daemon to <replaceable>LEVEL</replaceable> (accepts the same values as | |
798d3a52 ZJS |
229 | <option>--log-level=</option> described in |
230 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para> | |
231 | ||
90657286 YW |
232 | <para><command>systemd-analyze log-target</command> |
233 | prints the current log target of the <command>systemd</command> daemon. | |
234 | If an optional argument <replaceable>TARGET</replaceable> is provided, then the command changes the current log | |
235 | target of the <command>systemd</command> daemon to <replaceable>TARGET</replaceable> (accepts the same values as | |
b938cb90 | 236 | <option>--log-target=</option>, described in |
2ca2a91c LP |
237 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para> |
238 | ||
1eecafb8 | 239 | <para><command>systemd-analyze syscall-filter <optional><replaceable>SET</replaceable>…</optional></command> |
869feb33 ZJS |
240 | will list system calls contained in the specified system call set <replaceable>SET</replaceable>, |
241 | or all known sets if no sets are specified. Argument <replaceable>SET</replaceable> must include | |
242 | the <literal>@</literal> prefix.</para> | |
243 | ||
d941ea22 ZJS |
244 | <para><command>systemd-analyze verify</command> will load unit files and print |
245 | warnings if any errors are detected. Files specified on the command line will be | |
246 | loaded, but also any other units referenced by them. The full unit search path is | |
247 | formed by combining the directories for all command line arguments, and the usual unit | |
248 | load paths (variable <varname>$SYSTEMD_UNIT_PATH</varname> is supported, and may be | |
249 | used to replace or augment the compiled in set of unit load paths; see | |
250 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>). | |
251 | All units files present in the directories containing the command line arguments will | |
252 | be used in preference to the other paths.</para> | |
798d3a52 | 253 | |
6d86f4bd LP |
254 | <para><command>systemd-analyze calendar</command> will parse and normalize repetitive calendar time events, and |
255 | will calculate when they will elapse next. This takes the same input as the <varname>OnCalendar=</varname> setting | |
256 | in <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>, following the | |
257 | syntax described in | |
258 | <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> | |
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 | ||
798d3a52 ZJS |
404 | <xi:include href="user-system-options.xml" xpointer="host" /> |
405 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
406 | ||
407 | <xi:include href="standard-options.xml" xpointer="help" /> | |
408 | <xi:include href="standard-options.xml" xpointer="version" /> | |
409 | <xi:include href="standard-options.xml" xpointer="no-pager" /> | |
410 | </variablelist> | |
411 | ||
412 | </refsect1> | |
413 | ||
414 | <refsect1> | |
415 | <title>Exit status</title> | |
416 | ||
417 | <para>On success, 0 is returned, a non-zero failure code | |
418 | otherwise.</para> | |
419 | </refsect1> | |
420 | ||
421 | <refsect1> | |
422 | <title>Examples for <command>dot</command></title> | |
423 | ||
424 | <example> | |
425 | <title>Plots all dependencies of any unit whose name starts with | |
426 | <literal>avahi-daemon</literal></title> | |
427 | ||
428 | <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg | |
1de2a9a5 | 429 | $ eog avahi.svg</programlisting> |
798d3a52 ZJS |
430 | </example> |
431 | ||
432 | <example> | |
433 | <title>Plots the dependencies between all known target units</title> | |
434 | ||
1de2a9a5 | 435 | <programlisting>$ systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg |
816f25e8 | 436 | $ eog targets.svg</programlisting> |
798d3a52 ZJS |
437 | </example> |
438 | </refsect1> | |
816f25e8 | 439 | |
798d3a52 ZJS |
440 | <refsect1> |
441 | <title>Examples for <command>verify</command></title> | |
142c4eca | 442 | |
798d3a52 ZJS |
443 | <para>The following errors are currently detected:</para> |
444 | <itemizedlist> | |
445 | <listitem><para>unknown sections and directives, | |
446 | </para></listitem> | |
142c4eca | 447 | |
798d3a52 | 448 | <listitem><para>missing dependencies which are required to start |
2a03116d | 449 | the given unit,</para></listitem> |
142c4eca | 450 | |
798d3a52 ZJS |
451 | <listitem><para>man pages listed in |
452 | <varname>Documentation=</varname> which are not found in the | |
453 | system,</para></listitem> | |
142c4eca | 454 | |
798d3a52 ZJS |
455 | <listitem><para>commands listed in <varname>ExecStart=</varname> |
456 | and similar which are not found in the system or not | |
457 | executable.</para></listitem> | |
458 | </itemizedlist> | |
142c4eca | 459 | |
798d3a52 ZJS |
460 | <example> |
461 | <title>Misspelt directives</title> | |
142c4eca | 462 | |
798d3a52 | 463 | <programlisting>$ cat ./user.slice |
142c4eca ZJS |
464 | [Unit] |
465 | WhatIsThis=11 | |
466 | Documentation=man:nosuchfile(1) | |
467 | Requires=different.service | |
468 | ||
469 | [Service] | |
301a21a8 | 470 | Description=x |
142c4eca | 471 | |
ee9c4ff4 | 472 | $ systemd-analyze verify ./user.slice |
142c4eca ZJS |
473 | [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit' |
474 | [./user.slice:13] Unknown section 'Service'. Ignoring. | |
475 | Error: org.freedesktop.systemd1.LoadFailed: | |
798d3a52 ZJS |
476 | Unit different.service failed to load: |
477 | No such file or directory. | |
142c4eca ZJS |
478 | Failed to create user.slice/start: Invalid argument |
479 | user.slice: man nosuchfile(1) command failed with code 16 | |
798d3a52 ZJS |
480 | </programlisting> |
481 | </example> | |
142c4eca | 482 | |
798d3a52 ZJS |
483 | <example> |
484 | <title>Missing service units</title> | |
142c4eca | 485 | |
798d3a52 | 486 | <programlisting>$ tail ./a.socket ./b.socket |
142c4eca ZJS |
487 | ==> ./a.socket <== |
488 | [Socket] | |
489 | ListenStream=100 | |
490 | ||
491 | ==> ./b.socket <== | |
492 | [Socket] | |
493 | ListenStream=100 | |
494 | Accept=yes | |
495 | ||
ee9c4ff4 | 496 | $ systemd-analyze verify ./a.socket ./b.socket |
142c4eca ZJS |
497 | Service a.service not loaded, a.socket cannot be started. |
498 | Service b@0.service not loaded, b.socket cannot be started. | |
798d3a52 ZJS |
499 | </programlisting> |
500 | </example> | |
501 | </refsect1> | |
502 | ||
503 | <xi:include href="less-variables.xml" /> | |
504 | ||
505 | <refsect1> | |
506 | <title>See Also</title> | |
507 | <para> | |
508 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
509 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
510 | </para> | |
511 | </refsect1> | |
359deb60 LP |
512 | |
513 | </refentry> |