1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"systemd.automount">
8 <title>systemd.automount
</title>
9 <productname>systemd
</productname>
13 <refentrytitle>systemd.automount
</refentrytitle>
14 <manvolnum>5</manvolnum>
18 <refname>systemd.automount
</refname>
19 <refpurpose>Automount unit configuration
</refpurpose>
23 <para><filename><replaceable>automount
</replaceable>.automount
</filename></para>
27 <title>Description
</title>
29 <para>A unit configuration file whose name ends in
30 <literal>.automount
</literal> encodes information about a file
31 system automount point controlled and supervised by
34 <para>This man page lists the configuration options specific to
36 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
37 for the common options of all unit configuration files. The common
38 configuration items are configured in the generic [Unit] and
39 [Install] sections. The automount specific configuration options
40 are configured in the [Automount] section.
</para>
42 <para>Automount units must be named after the automount directories they control. Example: the automount point
43 <filename index=
"false">/home/lennart
</filename> must be configured in a unit file
44 <filename>home-lennart.automount
</filename>. For details about the escaping logic used to convert a file system
45 path to a unit name see
46 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note that
47 automount units cannot be templated, nor is it possible to add multiple names to an automount unit by creating
48 additional symlinks to its unit file.
</para>
50 <para>For each automount unit file a matching mount unit file (see
51 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
52 for details) must exist which is activated when the automount path
53 is accessed. Example: if an automount unit
54 <filename>home-lennart.automount
</filename> is active and the user
55 accesses
<filename>/home/lennart
</filename> the mount unit
56 <filename>home-lennart.mount
</filename> will be activated.
</para>
58 <para>Automount units may be used to implement on-demand mounting
59 as well as parallelized mounting of file systems.
</para>
61 <para>Note that automount units are separate from the mount itself, so you
62 should not set
<varname>After=
</varname> or
<varname>Requires=
</varname>
63 for mount dependencies here. For example, you should not set
64 <varname>After=network-online.target
</varname> or similar on network
65 filesystems. Doing so may result in an ordering cycle.
</para>
67 <para>Note that automount support on Linux is privileged, automount units are hence only available in the
68 system service manager (and root's user service manager), but not in unprivileged user's service
73 <title>Automatic Dependencies
</title>
76 <title>Implicit Dependencies
</title>
78 <para>The following dependencies are implicitly added:
</para>
81 <listitem><para>If an automount unit is beneath another mount unit in the
82 file system hierarchy, both a requirement and an ordering
83 dependency between both units are created automatically.
</para></listitem>
85 <listitem><para>An implicit
<varname>Before=
</varname> dependency is created
86 between an automount unit and the mount unit it activates.
</para></listitem>
91 <title>Default Dependencies
</title>
93 <para>The following dependencies are added unless
<varname>DefaultDependencies=no
</varname> is set:
</para>
96 <listitem><para>Automount units acquire automatic
<varname>Before=
</varname> and
97 <varname>Conflicts=
</varname> on
<filename>umount.target
</filename> in order to be stopped during
98 shutdown.
</para></listitem>
100 <listitem><para>Automount units automatically gain an
<varname>After=
</varname> dependency
101 on
<filename>local-fs-pre.target
</filename>, and a
<varname>Before=
</varname> dependency on
102 <filename>local-fs.target
</filename>.
</para></listitem>
108 <title><filename>fstab
</filename></title>
110 <para>Automount units may either be configured via unit files, or
111 via
<filename>/etc/fstab
</filename> (see
112 <citerefentry project='man-pages'
><refentrytitle>fstab
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
115 <para>For details how systemd parses
116 <filename>/etc/fstab
</filename> see
117 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
119 <para>If an automount point is configured in both
120 <filename>/etc/fstab
</filename> and a unit file, the configuration
121 in the latter takes precedence.
</para>
125 <title>Options
</title>
127 <para>Automount files must include an [Automount] section, which
128 carries information about the file system automount points it
129 supervises. The options specific to the [Automount] section of
130 automount units are the following:
</para>
132 <variablelist class='unit-directives'
>
135 <term><varname>Where=
</varname></term>
136 <listitem><para>Takes an absolute path of a directory of the
137 automount point. If the automount point does not exist at time
138 that the automount point is installed, it is created. This
139 string must be reflected in the unit filename. (See above.)
140 This option is mandatory.
</para></listitem>
144 <term><varname>DirectoryMode=
</varname></term>
145 <listitem><para>Directories of automount points (and any
146 parent directories) are automatically created if needed. This
147 option specifies the file system access mode used when
148 creating these directories. Takes an access mode in octal
149 notation. Defaults to
0755.
</para></listitem>
152 <term><varname>TimeoutIdleSec=
</varname></term>
153 <listitem><para>Configures an idle timeout. Once the mount has been
154 idle for the specified time, systemd will attempt to unmount. Takes a
155 unit-less value in seconds, or a time span value such as
"5min 20s".
156 Pass
0 to disable the timeout logic. The timeout is disabled by
157 default.
</para></listitem>
163 <title>See Also
</title>
165 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
166 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
167 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
168 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
169 <citerefentry project='man-pages'
><refentrytitle>mount
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
170 <citerefentry project='die-net'
><refentrytitle>automount
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
171 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>