]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.unit.xml
af89d316d5ed13cdcd7828803f9f4680d799b4f8
[thirdparty/systemd.git] / man / systemd.unit.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 2010 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 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 General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd.unit">
25
26 <refentryinfo>
27 <title>systemd.unit</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd.unit</refentrytitle>
42 <manvolnum>5</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.unit</refname>
47 <refpurpose>systemd unit configuration files</refpurpose>
48 </refnamediv>
49
50 <refsynopsisdiv>
51 <para><filename>systemd.service</filename></para>
52 <para><filename>systemd.socket</filename></para>
53 <para><filename>systemd.device</filename></para>
54 <para><filename>systemd.mount</filename></para>
55 <para><filename>systemd.automount</filename></para>
56 <para><filename>systemd.swap</filename></para>
57 <para><filename>systemd.target</filename></para>
58 <para><filename>systemd.path</filename></para>
59 <para><filename>systemd.timer</filename></para>
60 </refsynopsisdiv>
61
62 <refsect1>
63 <title>Description</title>
64
65 <para>A unit configuration file encodes information
66 about a service, a socket, a device, a mount point, an
67 automount point, a swap file or patition, a start-up
68 target, a file system path or a timer controlled and
69 supervised by <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>. The syntax is inspired by XDG
70 <filename>.desktop</filename> files, which are in turn
71 inspired by Microsoft Windows <filename>.ini</filename>
72 files.</para>
73
74 <para>This man pages lists the common configuration
75 options of the all unit types. These options need to
76 be configured either in the [Unit] resp. [Install]
77 section of the unit files.</para>
78 </refsect1>
79
80 <refsect1>
81 <title>Options</title>
82
83 <para>Unit file may include a [Unit] section, which
84 carries generic information about the unit that is not
85 dependent on the type of unit:</para>
86
87 <variablelist>
88 <varlistentry>
89 <term><varname>Names=</varname></term>
90
91 <listitem><para>Additional names for
92 this unit. The names listed here must
93 have the same suffix (i.e. type) as
94 the unit file name. This option may be
95 specified more than once, in which
96 case all listed names are used. Note
97 that this option is different from the
98 <varname>Alias=</varname> option from
99 the [Install] section mentioned
100 below. See below for details</para>
101 </listitem>
102 </varlistentry>
103 <varlistentry>
104 <term><varname>Requires=</varname></term>
105
106 <listitem><para>Requirement
107 dependencies on other units. If this
108 units get activated the units listed
109 here will be activated as well. If one
110 of the other units gets deactivated or
111 its activation fails, this unit will
112 be deactivated. This option may be
113 specified more than once, in which
114 case requirement dependencies for all
115 listed names are created.</para>
116 </listitem>
117 </varlistentry>
118 </variablelist>
119
120 <para>Unit file may include a [Install] section, which
121 carries installation information for the unit. This
122 section is not interpreted by
123 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
124 during runtime. It is used exclusively by the
125 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>
126 during installation of a unit:</para>
127
128 <variablelist>
129 <varlistentry>
130 <term><varname>Alias=</varname></term>
131
132 <listitem><para>Additional names this
133 unit shall be installed under. The
134 names listed here must have the same
135 suffix (i.e. type) as the unit file
136 name. This option may be specified
137 more than once, in which case all
138 listed names are used. At installation
139 time
140 <command>systemd-install</command>
141 will create symlinks from these names
142 to the unit file name. Note that this
143 is different from the
144 <varname>Names=</varname> option from
145 the [Unit] section mentioned above:
146 The names from
147 <varname>Names=</varname> apply
148 unconditionally if the unit is
149 loaded. The names from
150 <varname>Alias=</varname> apply only
151 if the unit is actually installed with
152 the <command>systemd-install</command>
153 tool. Also, if systemd searches for a
154 unit, it will discover symlinked alias
155 names, but not names configured only
156 with <varname>Names=</varname>. It is
157 a common pattern to list a name in both
158 options. In this case, a unit will be
159 active under all names if installed,
160 but also if not installed but
161 requested
162 explicitly.</para></listitem>
163 </varlistentry>
164 </variablelist>
165
166 </refsect1>
167
168 <refsect1>
169 <title>See Also</title>
170 <para>
171 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
172 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
173 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
174 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
175 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
177 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
178 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
179 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
180 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
181 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
182 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
183 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>
184 </para>
185 </refsect1>
186
187 </refentry>