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">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
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.
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.
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/>.
24 <refentry id=
"systemd.automount">
26 <title>systemd.automount
</title>
27 <productname>systemd
</productname>
31 <contrib>Developer
</contrib>
32 <firstname>Lennart
</firstname>
33 <surname>Poettering
</surname>
34 <email>lennart@poettering.net
</email>
40 <refentrytitle>systemd.automount
</refentrytitle>
41 <manvolnum>5</manvolnum>
45 <refname>systemd.automount
</refname>
46 <refpurpose>Automount unit configuration
</refpurpose>
50 <para><filename><replaceable>automount
</replaceable>.automount
</filename></para>
54 <title>Description
</title>
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
61 <para>This man page lists the configuration options specific to
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>
69 <para>Automount units must be named after the automount
70 directories they control. Example: the automount point
71 <filename noindex='true'
>/home/lennart
</filename> must be
72 configured in a unit file
73 <filename>home-lennart.automount
</filename>. For details about the
74 escaping logic used to convert a file system path to a unit name
76 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
78 <para>For each automount unit file a matching mount unit file (see
79 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
80 for details) must exist which is activated when the automount path
81 is accessed. Example: if an automount unit
82 <filename>home-lennart.automount
</filename> is active and the user
83 accesses
<filename>/home/lennart
</filename> the mount unit
84 <filename>home-lennart.mount
</filename> will be activated.
</para>
86 <para>Automount units may be used to implement on-demand mounting
87 as well as parallelized mounting of file systems.
</para>
91 <title>Automatic Dependencies
</title>
93 <para>If an automount unit is beneath another mount unit in the
94 file system hierarchy, both a requirement and an ordering
95 dependency between both units are created automatically.
</para>
97 <para>An implicit
<varname>Before=
</varname> dependency is created
98 between an automount unit and the mount unit it activates.
</para>
100 <para>Automount units acquire automatic
<varname>Before=
</varname> and
<varname>Conflicts=
</varname> on
101 <filename>umount.target
</filename> in order to be stopped during shutdown, unless
102 <varname>DefaultDependencies=no
</varname> is set in the
<literal>[Unit]
</literal> section.
</para>
107 <title><filename>fstab
</filename></title>
109 <para>Automount units may either be configured via unit files, or
110 via
<filename>/etc/fstab
</filename> (see
111 <citerefentry project='man-pages'
><refentrytitle>fstab
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
114 <para>For details how systemd parses
115 <filename>/etc/fstab
</filename> see
116 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
118 <para>If an automount point is configured in both
119 <filename>/etc/fstab
</filename> and a unit file, the configuration
120 in the latter takes precedence.
</para>
124 <title>Options
</title>
126 <para>Automount files must include an [Automount] section, which
127 carries information about the file system automount points it
128 supervises. The options specific to the [Automount] section of
129 automount units are the following:
</para>
131 <variablelist class='unit-directives'
>
134 <term><varname>Where=
</varname></term>
135 <listitem><para>Takes an absolute path of a directory of the
136 automount point. If the automount point does not exist at time
137 that the automount point is installed, it is created. This
138 string must be reflected in the unit filename. (See above.)
139 This option is mandatory.
</para></listitem>
143 <term><varname>DirectoryMode=
</varname></term>
144 <listitem><para>Directories of automount points (and any
145 parent directories) are automatically created if needed. This
146 option specifies the file system access mode used when
147 creating these directories. Takes an access mode in octal
148 notation. Defaults to
0755.
</para></listitem>
151 <term><varname>TimeoutIdleSec=
</varname></term>
152 <listitem><para>Configures an idle timeout. Once the mount has been
153 idle for the specified time, systemd will attempt to unmount. Takes a
154 unit-less value in seconds, or a time span value such as
"5min 20s".
155 Pass
0 to disable the timeout logic. The timeout is disabled by
156 default.
</para></listitem>
162 <title>See Also
</title>
164 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
165 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
166 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
167 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
168 <citerefentry project='man-pages'
><refentrytitle>mount
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
169 <citerefentry project='die-net'
><refentrytitle>automount
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
170 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>