chiark / gitweb /
man: Clarify man page with respect to automatic fstab dependencies
[elogind.git] / man / systemd.mount.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="systemd.mount">
26         <refentryinfo>
27                 <title>systemd.mount</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.mount</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.mount</refname>
47                 <refpurpose>systemd mount configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.mount</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.mount</filename> encodes information about
59                 a file system mount point controlled and supervised by
60                 systemd.</para>
61
62                 <para>This man page lists the configuration options
63                 specific to this unit type. See
64                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65                 for the common options of all unit configuration
66                 files. The common configuration items are configured
67                 in the generic [Unit] and [Install] sections. The
68                 mount specific configuration options are configured
69                 in the [Mount] section.</para>
70
71                 <para>Additional options are listed in
72                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
73                 which define the execution environment the
74                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
75                 binary is executed in.</para>
76
77                 <para>Mount units must be named after the mount point
78                 directories they control. Example: the mount point
79                 <filename>/home/lennart</filename> must be configured
80                 in a unit file
81                 <filename>home-lennart.mount</filename>. For details
82                 about the escaping logic used to convert a file system
83                 path to a unit name see
84                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
85
86                 <para>Optionally, a mount unit may be accompanied by
87                 an automount unit, to allow on-demand or parallelized
88                 mounting. See
89                 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
90
91                 <para>If an mount point is beneath another mount point
92                 in the file system hierarchy, a dependency between both
93                 units is created automatically.</para>
94
95                 <para>Mount points created at runtime independent on
96                 unit files or <filename>/etc/fstab</filename> will be
97                 monitored by systemd and appear like any other mount
98                 unit in systemd.</para>
99         </refsect1>
100
101         <refsect1>
102                 <title><filename>/etc/fstab</filename></title>
103
104                 <para>Mount units may either be configured via unit
105                 files, or via <filename>/etc/fstab</filename> (see
106                 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
107                 for details).</para>
108
109                 <para>When reading <filename>/etc/fstab</filename> a
110                 few special mount options are understood by systemd
111                 which influence how dependencies are created for mount
112                 points from <filename>/etc/fstab</filename>. If
113                 <option>MountAuto=yes</option> is set in
114                 <filename>system.conf</filename> (which is the
115                 default), or if <option>x-systemd.mount</option> is
116                 specified as mount option, then systemd will create a
117                 dependency of type <option>Wants</option> from either
118                 <filename>local-fs.target</filename> or
119                 <filename>remote-fs.target</filename>, depending
120                 whether the file system is local or remote. If
121                 <option>x-systemd.automount</option> is set, an
122                 automount unit will be created for the file
123                 system. See
124                 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
125                 for details. If
126                 <option>x-systemd-device-timeout=</option> is
127                 specified it may be used to configure how long systemd
128                 should wait for a device to show up before giving up
129                 on an entry from
130                 <filename>/etc/fstab</filename>. Specify a time in
131                 seconds or explicitly specifiy a unit as
132                 <literal>s</literal>, <literal>min</literal>,
133                 <literal>h</literal>, <literal>ms</literal>.</para>
134
135                 <para>If a mount point is configured in both
136                 <filename>/etc/fstab</filename> and a unit file, the
137                 configuration in the latter takes precedence.</para>
138         </refsect1>
139
140         <refsect1>
141                 <title>Options</title>
142
143                 <para>Mount files must include a [Mount] section,
144                 which carries information about the file system mount points it
145                 supervises. A number of options that may be used in
146                 this section are shared with other unit types. These
147                 options are documented in
148                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
149                 options specific to the [Mount] section of mount
150                 units are the following:</para>
151
152                 <variablelist>
153
154                         <varlistentry>
155                                 <term><varname>What=</varname></term>
156                                 <listitem><para>Takes an absolute path
157                                 of a device node, file or other
158                                 resource to mount. See
159                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
160                                 for details. If this refers to a
161                                 device node, a dependency on the
162                                 respective device unit is
163                                 automatically created. (See
164                                 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
165                                 This option is
166                                 mandatory.</para></listitem>
167                         </varlistentry>
168
169                         <varlistentry>
170                                 <term><varname>Where=</varname></term>
171                                 <listitem><para>Takes an absolute path
172                                 of a directory of the mount point. If
173                                 the mount point is not existing at
174                                 time of mounting, it is created. This
175                                 string must be reflected in the unit
176                                 file name. (See above.) This option is
177                                 mandatory.</para></listitem>
178                         </varlistentry>
179
180                         <varlistentry>
181                                 <term><varname>Type=</varname></term>
182                                 <listitem><para>Takes a string for the
183                                 filesystem type. See
184                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
185                                 for details. This setting is
186                                 optional.</para></listitem>
187                         </varlistentry>
188
189                         <varlistentry>
190                                 <term><varname>Options=</varname></term>
191
192                                 <listitem><para>Mount options to use
193                                 when mounting. This takes a comma
194                                 separated list of options. This
195                                 setting is optional.</para></listitem>
196                         </varlistentry>
197
198                         <varlistentry>
199                                 <term><varname>DirectoryMode=</varname></term>
200                                 <listitem><para>Directories of mount
201                                 points (and any parent directories)
202                                 are automatically created if
203                                 needed. This option specifies the file
204                                 system access mode used when creating
205                                 these directories. Takes an access
206                                 mode in octal notation. Defaults to
207                                 0755.</para></listitem>
208                         </varlistentry>
209
210                         <varlistentry>
211                                 <term><varname>TimeoutSec=</varname></term>
212                                 <listitem><para>Configures the time to
213                                 wait for the mount command to
214                                 finish. If a command does not exit
215                                 within the configured time the mount
216                                 will be considered failed and be shut
217                                 down again. All commands still running
218                                 will be terminated forcibly via
219                                 SIGTERM, and after another delay of
220                                 this time with SIGKILL. (See
221                                 <option>KillMode=</option> below.)
222                                 Takes a unit-less value in seconds, or
223                                 a time span value such as "5min
224                                 20s". Pass 0 to disable the timeout
225                                 logic. Defaults to
226                                 90s.</para></listitem>
227                         </varlistentry>
228
229                         <varlistentry>
230                                 <term><varname>KillMode=</varname></term>
231                                 <listitem><para>Specifies how
232                                 processes of this mount shall be
233                                 killed. One of
234                                 <option>control-group</option>,
235                                 <option>process</option>,
236                                 <option>none</option>.</para>
237
238                                 <para>This option is mostly equivalent
239                                 to the <option>KillMode=</option>
240                                 option of service files. See
241                                 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
242                                 for details.</para></listitem>
243                         </varlistentry>
244
245                         <varlistentry>
246                                 <term><varname>KillSignal=</varname></term>
247                                 <listitem><para>Specifies which signal
248                                 to use when killing a process of this
249                                 mount. Defaults to SIGTERM.
250                                 </para></listitem>
251                         </varlistentry>
252
253                         <varlistentry>
254                                 <term><varname>SendSIGKILL=</varname></term>
255                                 <listitem><para>Specifies whether to
256                                 send SIGKILL to remaining processes
257                                 after a timeout, if the normal
258                                 shutdown procedure left processes of
259                                 the mount around. Takes a boolean
260                                 value. Defaults to "yes".
261                                 </para></listitem>
262                         </varlistentry>
263                 </variablelist>
264         </refsect1>
265
266         <refsect1>
267                   <title>See Also</title>
268                   <para>
269                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
270                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
271                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
272                           <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
273                           <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
274                           <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
275                   </para>
276         </refsect1>
277
278 </refentry>