]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.automount.xml
Merge pull request #6830 from keszybz/generator-dirs
[thirdparty/systemd.git] / man / systemd.automount.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 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.automount">
25 <refentryinfo>
26 <title>systemd.automount</title>
27 <productname>systemd</productname>
28
29 <authorgroup>
30 <author>
31 <contrib>Developer</contrib>
32 <firstname>Lennart</firstname>
33 <surname>Poettering</surname>
34 <email>lennart@poettering.net</email>
35 </author>
36 </authorgroup>
37 </refentryinfo>
38
39 <refmeta>
40 <refentrytitle>systemd.automount</refentrytitle>
41 <manvolnum>5</manvolnum>
42 </refmeta>
43
44 <refnamediv>
45 <refname>systemd.automount</refname>
46 <refpurpose>Automount unit configuration</refpurpose>
47 </refnamediv>
48
49 <refsynopsisdiv>
50 <para><filename><replaceable>automount</replaceable>.automount</filename></para>
51 </refsynopsisdiv>
52
53 <refsect1>
54 <title>Description</title>
55
56 <para>A unit configuration file whose name ends in
57 <literal>.automount</literal> encodes information about a file
58 system automount point controlled and supervised by
59 systemd.</para>
60
61 <para>This man page lists the configuration options specific to
62 this unit type. See
63 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
64 for the common options of all unit configuration files. The common
65 configuration items are configured in the generic [Unit] and
66 [Install] sections. The automount specific configuration options
67 are configured in the [Automount] section.</para>
68
69 <para>Automount units must be named after the automount directories they control. Example: the automount point
70 <filename noindex='true'>/home/lennart</filename> must be configured in a unit file
71 <filename>home-lennart.automount</filename>. For details about the escaping logic used to convert a file system
72 path to a unit name see
73 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note that
74 automount units cannot be templated, nor is it possible to add multiple names to an automount unit by creating
75 additional symlinks to its unit file.</para>
76
77 <para>For each automount unit file a matching mount unit file (see
78 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
79 for details) must exist which is activated when the automount path
80 is accessed. Example: if an automount unit
81 <filename>home-lennart.automount</filename> is active and the user
82 accesses <filename>/home/lennart</filename> the mount unit
83 <filename>home-lennart.mount</filename> will be activated.</para>
84
85 <para>Automount units may be used to implement on-demand mounting
86 as well as parallelized mounting of file systems.</para>
87 </refsect1>
88
89 <refsect1>
90 <title>Implicit Dependencies</title>
91
92 <para>The following dependencies are implicitly added:</para>
93
94 <itemizedlist>
95 <listitem><para>If an automount unit is beneath another mount unit in the
96 file system hierarchy, both a requirement and an ordering
97 dependency between both units are created automatically.</para></listitem>
98
99 <listitem><para>An implicit <varname>Before=</varname> dependency is created
100 between an automount unit and the mount unit it activates.</para></listitem>
101 </itemizedlist>
102 </refsect1>
103
104 <refsect1>
105 <title>Default Dependencies</title>
106
107 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
108
109 <itemizedlist>
110 <listitem><para>Automount units acquire automatic <varname>Before=</varname> and
111 <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
112 shutdown.</para></listitem>
113 </itemizedlist>
114 </refsect1>
115
116 <refsect1>
117 <title><filename>fstab</filename></title>
118
119 <para>Automount units may either be configured via unit files, or
120 via <filename>/etc/fstab</filename> (see
121 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
122 for details).</para>
123
124 <para>For details how systemd parses
125 <filename>/etc/fstab</filename> see
126 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
127
128 <para>If an automount point is configured in both
129 <filename>/etc/fstab</filename> and a unit file, the configuration
130 in the latter takes precedence.</para>
131 </refsect1>
132
133 <refsect1>
134 <title>Options</title>
135
136 <para>Automount files must include an [Automount] section, which
137 carries information about the file system automount points it
138 supervises. The options specific to the [Automount] section of
139 automount units are the following:</para>
140
141 <variablelist class='unit-directives'>
142
143 <varlistentry>
144 <term><varname>Where=</varname></term>
145 <listitem><para>Takes an absolute path of a directory of the
146 automount point. If the automount point does not exist at time
147 that the automount point is installed, it is created. This
148 string must be reflected in the unit filename. (See above.)
149 This option is mandatory.</para></listitem>
150 </varlistentry>
151
152 <varlistentry>
153 <term><varname>DirectoryMode=</varname></term>
154 <listitem><para>Directories of automount points (and any
155 parent directories) are automatically created if needed. This
156 option specifies the file system access mode used when
157 creating these directories. Takes an access mode in octal
158 notation. Defaults to 0755.</para></listitem>
159 </varlistentry>
160 <varlistentry>
161 <term><varname>TimeoutIdleSec=</varname></term>
162 <listitem><para>Configures an idle timeout. Once the mount has been
163 idle for the specified time, systemd will attempt to unmount. Takes a
164 unit-less value in seconds, or a time span value such as "5min 20s".
165 Pass 0 to disable the timeout logic. The timeout is disabled by
166 default.</para></listitem>
167 </varlistentry>
168 </variablelist>
169 </refsect1>
170
171 <refsect1>
172 <title>See Also</title>
173 <para>
174 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
175 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
177 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
178 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
179 <citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
180 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
181 </para>
182 </refsect1>
183
184 </refentry>