chiark / gitweb /
shell-completion: systemd-analyze verify, systemctl link
[elogind.git] / man / systemd-verify.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2014 Zbigniew JÄ™drzejewski-Szmek
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-verify"
25           xmlns:xi="http://www.w3.org/2001/XInclude">
26
27   <refentryinfo>
28     <title>systemd-verify</title>
29     <productname>systemd</productname>
30
31     <authorgroup>
32       <author>
33         <contrib>Developer</contrib>
34         <firstname>Zbigniew</firstname>
35         <surname>JÄ™drzejewski-Szmek</surname>
36         <email>zbyszek@in.waw.pl</email>
37       </author>
38     </authorgroup>
39   </refentryinfo>
40
41   <refmeta>
42     <refentrytitle>systemd-verify</refentrytitle>
43     <manvolnum>1</manvolnum>
44   </refmeta>
45
46   <refnamediv>
47     <refname>systemd-verify</refname>
48     <refpurpose>Check unit file validity</refpurpose>
49   </refnamediv>
50
51   <refsynopsisdiv>
52     <cmdsynopsis>
53       <command>systemd-verify</command>
54       <arg choice="opt" rep="repeat">OPTIONS</arg>
55       <arg choice="opt" rep="repeat">FILES</arg>
56     </cmdsynopsis>
57   </refsynopsisdiv>
58
59   <refsect1>
60     <title>Description</title>
61
62     <para><filename>systemd-verify</filename> will load unit files and
63     potentially print warnings if any errors are detected. Files
64     specified on the command line will be loaded, but also any other
65     units referenced by them.</para>
66
67     <para>This command works by prepending the directories for all
68     command line arguments at the beginning of the unit load path.
69     This means that all units files found in those directories will
70     be used in preference to the unit files found in the standard
71     locations, even if not listed explicitly.</para>
72
73     <para>The following errors are currently detected:</para>
74     <itemizedlist>
75       <listitem><para>unknown sections and directives,
76       </para></listitem>
77
78       <listitem><para>missing dependencies which are required to start
79       the given unit,</para></listitem>
80
81       <listitem><para>man pages listed in
82       <varname>Documentation=</varname> which are not found in the
83       system,</para></listitem>
84
85       <listitem><para>commands listed in <varname>ExecStart=</varname>
86       and similar which are not found in the system or not executable.
87       </para></listitem>
88     </itemizedlist>
89   </refsect1>
90
91   <refsect1>
92     <title>Options</title>
93
94     <para>The following options are understood:</para>
95
96     <variablelist>
97       <varlistentry>
98         <term><option>--no-man</option></term>
99
100         <listitem><para>Do not invoke man to verify the existence
101         of man pages listen in <varname>Documentation=</varname>.
102         </para></listitem>
103       </varlistentry>
104
105       <xi:include href="user-system-options.xml" xpointer="user" />
106       <xi:include href="user-system-options.xml" xpointer="system" />
107
108       <xi:include href="standard-options.xml" xpointer="help" />
109       <xi:include href="standard-options.xml" xpointer="version" />
110     </variablelist>
111   </refsect1>
112
113   <refsect1>
114     <title>Exit status</title>
115
116     <para>On success, 0 is returned, a non-zero failure
117     code otherwise.</para>
118   </refsect1>
119
120   <refsect1>
121     <title>Examples</title>
122
123     <example>
124       <title>Misspelt directives</title>
125
126       <programlisting>$ cat ./user.slice
127 [Unit]
128 WhatIsThis=11
129 Documentation=man:systemd.nosuchfile(7)
130 Requires=different.service
131
132 [Service]
133 Desription=x
134
135 $ systemd-verify ./user.slice
136 [./user.slice:9] Unknown lvalue 'WhatIsThis' in section 'Unit'
137 [./user.slice:13] Unknown section 'Service'. Ignoring.
138 Error: org.freedesktop.systemd1.LoadFailed: Unit different.service failed to load: No such file or directory.
139 Failed to create user.slice/start: Invalid argument
140 user.slice: man systemd.nosuchfile(7) command failed with code 16
141 </programlisting>
142     </example>
143
144     <example>
145       <title>Missing service units</title>
146
147       <programlisting>$ tail ./a.socket ./b.socket
148 ==> ./a.socket &lt;==
149 [Socket]
150 ListenStream=100
151
152 ==> ./b.socket &lt;==
153 [Socket]
154 ListenStream=100
155 Accept=yes
156
157 $ systemd-verify ./a.socket ./b.socket
158 Service a.service not loaded, a.socket cannot be started.
159 Service b@0.service not loaded, b.socket cannot be started.
160 </programlisting>
161     </example>
162
163   </refsect1>
164
165   <refsect1>
166     <title>See Also</title>
167     <para>
168       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
169       <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
170       <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
171       <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
172     </para>
173   </refsect1>
174 </refentry>