]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/systemd-analyze.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / systemd-analyze.xml
index d2db265f5858ef525bc1cf002bb7af02e923b27d..97a9b2cca7821db745565004b78fc13887b9358c 100644 (file)
@@ -3,6 +3,8 @@
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 
 <!--
+  SPDX-License-Identifier: LGPL-2.1+
+
   This file is part of systemd.
 
   Copyright 2012 Lennart Poettering
@@ -51,7 +53,7 @@
 
   <refnamediv>
     <refname>systemd-analyze</refname>
-    <refpurpose>Analyze system boot-up performance</refpurpose>
+    <refpurpose>Analyze and debug system manager</refpurpose>
   </refnamediv>
 
   <refsynopsisdiv>
     <cmdsynopsis>
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
-      <arg choice="plain">set-log-level</arg>
-      <arg choice="plain"><replaceable>LEVEL</replaceable></arg>
+      <arg choice="plain">unit-paths</arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>systemd-analyze</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+      <arg choice="plain">log-level</arg>
+      <arg choice="opt"><replaceable>LEVEL</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>systemd-analyze</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+      <arg choice="plain">log-target</arg>
+      <arg choice="opt"><replaceable>TARGET</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
-      <arg choice="plain">set-log-target</arg>
-      <arg choice="plain"><replaceable>TARGET</replaceable></arg>
+      <arg choice="plain">syscall-filter</arg>
+      <arg choice="opt"><replaceable>SET</replaceable>…</arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
       <arg choice="plain">verify</arg>
       <arg choice="opt" rep="repeat"><replaceable>FILES</replaceable></arg>
     </cmdsynopsis>
+    <cmdsynopsis>
+      <command>systemd-analyze</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+      <arg choice="plain">calendar</arg>
+      <arg choice="plain" rep="repeat"><replaceable>SPECS</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>systemd-analyze</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+      <arg choice="plain">service-watchdogs</arg>
+      <arg choice="opt"><replaceable>BOOL</replaceable></arg>
+    </cmdsynopsis>
   </refsynopsisdiv>
 
   <refsect1>
     <para><command>systemd-analyze</command> may 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.</para>
+    verify the correctness of unit files. It is also used to access
+    special functions useful for advanced system manager debugging.</para>
 
     <para><command>systemd-analyze time</command> prints the time
     spent in the kernel before userspace has been reached, the time
     initialization of another service to complete.</para>
 
     <para><command>systemd-analyze critical-chain
-    [<replaceable>UNIT...</replaceable>]</command> prints a tree of
+    [<replaceable>UNIT</replaceable>]</command> prints a tree of
     the time-critical chain of units (for each of the specified
     <replaceable>UNIT</replaceable>s or for the default target
     otherwise). The time after the unit is active or started is
     state. Its format is subject to change without notice and should
     not be parsed by applications.</para>
 
-    <para><command>systemd-analyze set-log-level
-    <replaceable>LEVEL</replaceable></command> changes the current log
-    level of the <command>systemd</command> daemon to
-    <replaceable>LEVEL</replaceable> (accepts the same values as
+    <para><command>systemd-analyze unit-paths</command> outputs a list of all
+    directories from which unit files, <filename>.d</filename> overrides, and
+    <filename>.wants</filename>, <filename>.requires</filename> symlinks may be
+    loaded. Combine with <option>--user</option> to retrieve the list for the user
+    manager instance, and <option>--global</option> for the global configuration of
+    user manager instances. Note that this verb prints the list that is compiled into
+    <command>systemd-analyze</command> itself, and does not comunicate with the
+    running manager. Use
+    <programlisting>systemctl [--user] [--global] show -p UnitPath --value</programlisting>
+    to retrieve the actual list that the manager uses, with any empty directories
+    omitted.</para>
+
+    <para><command>systemd-analyze log-level</command>
+    prints the current log level of the <command>systemd</command> daemon.
+    If an optional argument <replaceable>LEVEL</replaceable> is provided, then the command changes the current log
+    level of the <command>systemd</command> daemon to <replaceable>LEVEL</replaceable> (accepts the same values as
     <option>--log-level=</option> described in
     <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para>
 
-    <para><command>systemd-analyze set-log-target
-    <replaceable>TARGET</replaceable></command> changes the current log
-    target of the <command>systemd</command> daemon to
-    <replaceable>TARGET</replaceable> (accepts the same values as
-    <option>--log-target=</option> described in
+    <para><command>systemd-analyze log-target</command>
+    prints the current log target of the <command>systemd</command> daemon.
+    If an optional argument <replaceable>TARGET</replaceable> is provided, then the command changes the current log
+    target of the <command>systemd</command> daemon to <replaceable>TARGET</replaceable> (accepts the same values as
+    <option>--log-target=</option>, described in
     <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).</para>
 
-    <para><command>systemd-analyze verify</command> will 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.</para>
+    <para><command>systemd-analyze syscall-filter <optional><replaceable>SET</replaceable>…</optional></command>
+    will list system calls contained in the specified system call set <replaceable>SET</replaceable>,
+    or all known sets if no sets are specified. Argument <replaceable>SET</replaceable> must include
+    the <literal>@</literal> prefix.</para>
+
+    <para><command>systemd-analyze verify</command> will 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. The full unit search path is
+    formed by combining the directories for all command line arguments, and the usual unit
+    load paths (variable <varname>$SYSTEMD_UNIT_PATH</varname> is supported, and may be
+    used to replace or augment the compiled in set of unit load paths; see
+    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
+    All units files present in the directories containing the command line arguments will
+    be used in preference to the other paths.</para>
+
+    <para><command>systemd-analyze calendar</command> will parse and normalize repetitive calendar time events, and
+    will calculate when they will elapse next. This takes the same input as the <varname>OnCalendar=</varname> setting
+    in <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>, following the
+    syntax described in
+    <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
+
+    <para><command>systemd-analyze service-watchdogs</command>
+    prints the current state of service runtime watchdogs of the <command>systemd</command> daemon.
+    If an optional boolean argument is provided, then globally enables or disables the service
+    runtime watchdogs (<option>WatchdogSec=</option>) and emergency actions (e.g.
+    <option>OnFailure=</option> or <option>StartLimitAction=</option>); see
+    <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+    The hardware watchdog is not affected by this setting.</para>
 
     <para>If no command is passed, <command>systemd-analyze
     time</command> is implied.</para>
     <para>The following options are understood:</para>
 
     <variablelist>
+      <varlistentry>
+        <term><option>--system</option></term>
+
+        <listitem><para>Operates on the system systemd instance. This
+        is the implied default.</para></listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><option>--user</option></term>
 
       </varlistentry>
 
       <varlistentry>
-        <term><option>--system</option></term>
+        <term><option>--global</option></term>
 
-        <listitem><para>Operates on the system systemd instance. This
-        is the implied default.</para></listitem>
+        <listitem><para>Operates on the system-wide configuration for
+        user systemd instance.</para></listitem>
       </varlistentry>
 
       <varlistentry>
         <varname>After=</varname> or <varname>Before=</varname> are
         shown. If <option>--require</option> is passed, only
         dependencies of type <varname>Requires=</varname>,
-        <varname>RequiresOverridable=</varname>,
         <varname>Requisite=</varname>,
-        <varname>RequisiteOverridable=</varname>,
         <varname>Wants=</varname> and <varname>Conflicts=</varname>
         are shown. If neither is passed, this shows dependencies of
         all these types.</para></listitem>
       </varlistentry>
 
       <varlistentry>
-        <term><option>--no-man</option></term>
+        <term><option>--man=no</option></term>
 
         <listitem><para>Do not invoke man to verify the existence of
         man pages listed in <varname>Documentation=</varname>.
         </para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><option>--generators</option></term>
+
+        <listitem><para>Invoke unit generators, see
+        <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
+        Some generators require root privileges. Under a normal user, running with
+        generators enabled will generally result in some warnings.</para></listitem>
+      </varlistentry>
+
       <xi:include href="user-system-options.xml" xpointer="host" />
       <xi:include href="user-system-options.xml" xpointer="machine" />
 
       <literal>avahi-daemon</literal></title>
 
       <programlisting>$ systemd-analyze dot 'avahi-daemon.*' | dot -Tsvg > avahi.svg
-      $ eog avahi.svg</programlisting>
+$ eog avahi.svg</programlisting>
     </example>
 
     <example>
       <title>Plots the dependencies between all known target units</title>
 
-      <programlisting>systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
+      <programlisting>systemd-analyze dot --to-pattern='*.target' --from-pattern='*.target' | dot -Tsvg > targets.svg
 $ eog targets.svg</programlisting>
     </example>
   </refsect1>
@@ -323,7 +395,7 @@ $ eog targets.svg</programlisting>
       </para></listitem>
 
       <listitem><para>missing dependencies which are required to start
-      the given unit, </para></listitem>
+      the given unit,</para></listitem>
 
       <listitem><para>man pages listed in
       <varname>Documentation=</varname> which are not found in the
@@ -344,7 +416,7 @@ Documentation=man:nosuchfile(1)
 Requires=different.service
 
 [Service]
-Desription=x
+Description=x
 
 $ systemd-analyze verify ./user.slice
 [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'