]>
Commit | Line | Data |
---|---|---|
65232ea7 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
eea10b26 | 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
65232ea7 | 5 | |
d8e1613e | 6 | <refentry id="systemd.automount" xmlns:xi="http://www.w3.org/2001/XInclude"> |
798d3a52 ZJS |
7 | <refentryinfo> |
8 | <title>systemd.automount</title> | |
9 | <productname>systemd</productname> | |
798d3a52 ZJS |
10 | </refentryinfo> |
11 | ||
12 | <refmeta> | |
13 | <refentrytitle>systemd.automount</refentrytitle> | |
14 | <manvolnum>5</manvolnum> | |
15 | </refmeta> | |
16 | ||
17 | <refnamediv> | |
18 | <refname>systemd.automount</refname> | |
19 | <refpurpose>Automount unit configuration</refpurpose> | |
20 | </refnamediv> | |
21 | ||
22 | <refsynopsisdiv> | |
23 | <para><filename><replaceable>automount</replaceable>.automount</filename></para> | |
24 | </refsynopsisdiv> | |
25 | ||
26 | <refsect1> | |
27 | <title>Description</title> | |
28 | ||
93dbc22a ZJS |
29 | <para>A unit configuration file whose name ends in <literal>.automount</literal> encodes information |
30 | about a file system automount point controlled and supervised by systemd. Automount units may be used to | |
31 | implement on-demand mounting as well as parallelized mounting of file systems.</para> | |
798d3a52 ZJS |
32 | |
33 | <para>This man page lists the configuration options specific to | |
34 | this unit type. See | |
35 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
36 | for the common options of all unit configuration files. The common | |
bdac5608 ZJS |
37 | configuration items are configured in the generic [Unit] and |
38 | [Install] sections. The automount specific configuration options | |
39 | are configured in the [Automount] section.</para> | |
798d3a52 | 40 | |
19cb8279 ZJS |
41 | <para>Automount units must be named after the automount directories they control. Example: the automount |
42 | point <filename index="false">/home/lennart</filename> must be configured in a unit file | |
43 | <filename>home-lennart.automount</filename>. For details about the escaping logic used to convert a file | |
44 | system path to a unit name see | |
45 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note | |
46 | that automount units cannot be templated, nor is it possible to add multiple names to an automount unit | |
47 | by creating symlinks to its unit file.</para> | |
798d3a52 ZJS |
48 | |
49 | <para>For each automount unit file a matching mount unit file (see | |
50 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
51 | for details) must exist which is activated when the automount path | |
52 | is accessed. Example: if an automount unit | |
53 | <filename>home-lennart.automount</filename> is active and the user | |
54 | accesses <filename>/home/lennart</filename> the mount unit | |
55 | <filename>home-lennart.mount</filename> will be activated.</para> | |
56 | ||
69876f94 CD |
57 | <para>Note that automount units are separate from the mount itself, so you |
58 | should not set <varname>After=</varname> or <varname>Requires=</varname> | |
59 | for mount dependencies here. For example, you should not set | |
60 | <varname>After=network-online.target</varname> or similar on network | |
61 | filesystems. Doing so may result in an ordering cycle.</para> | |
eef34a1d LP |
62 | |
63 | <para>Note that automount support on Linux is privileged, automount units are hence only available in the | |
93dbc22a ZJS |
64 | system service manager (and root's user service manager), but not in unprivileged users' service |
65 | managers.</para> | |
223a359f ZJS |
66 | |
67 | <para>Note that automount units should not be nested. (The establishment of the inner automount point | |
68 | would unconditionally pin the outer mount point, defeating its purpose.)</para> | |
c129bd5d LP |
69 | </refsect1> |
70 | ||
71 | <refsect1> | |
aed5cb03 | 72 | <title>Automatic Dependencies</title> |
c129bd5d | 73 | |
aed5cb03 ZJS |
74 | <refsect2> |
75 | <title>Implicit Dependencies</title> | |
c129bd5d | 76 | |
aed5cb03 | 77 | <para>The following dependencies are implicitly added:</para> |
c129bd5d | 78 | |
aed5cb03 | 79 | <itemizedlist> |
93dbc22a ZJS |
80 | <listitem><para>If an automount unit is beneath another mount unit in the file system hierarchy, a |
81 | requirement and ordering dependencies are created to the on the unit higher in the hierarchy. | |
82 | </para></listitem> | |
45f09f93 | 83 | |
93dbc22a ZJS |
84 | <listitem><para>An implicit <varname>Before=</varname> dependency is created between an automount |
85 | unit and the mount unit it activates.</para></listitem> | |
aed5cb03 ZJS |
86 | </itemizedlist> |
87 | </refsect2> | |
88 | ||
89 | <refsect2> | |
90 | <title>Default Dependencies</title> | |
45f09f93 | 91 | |
aed5cb03 | 92 | <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para> |
798d3a52 | 93 | |
aed5cb03 ZJS |
94 | <itemizedlist> |
95 | <listitem><para>Automount units acquire automatic <varname>Before=</varname> and | |
96 | <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during | |
97 | shutdown.</para></listitem> | |
b3d7aef5 FB |
98 | |
99 | <listitem><para>Automount units automatically gain an <varname>After=</varname> dependency | |
100 | on <filename>local-fs-pre.target</filename>, and a <varname>Before=</varname> dependency on | |
101 | <filename>local-fs.target</filename>.</para></listitem> | |
aed5cb03 ZJS |
102 | </itemizedlist> |
103 | </refsect2> | |
798d3a52 ZJS |
104 | </refsect1> |
105 | ||
106 | <refsect1> | |
107 | <title><filename>fstab</filename></title> | |
108 | ||
109 | <para>Automount units may either be configured via unit files, or | |
110 | via <filename>/etc/fstab</filename> (see | |
3ba3a79d | 111 | <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
798d3a52 ZJS |
112 | for details).</para> |
113 | ||
114 | <para>For details how systemd parses | |
115 | <filename>/etc/fstab</filename> see | |
116 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
117 | ||
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> | |
121 | </refsect1> | |
122 | ||
123 | <refsect1> | |
124 | <title>Options</title> | |
125 | ||
d8e1613e ZJS |
126 | <para>Automount unit files may include [Unit] and [Install] sections, which are described in |
127 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
128 | </para> | |
129 | ||
130 | <para>Automount unit files must include an [Automount] section, which | |
798d3a52 ZJS |
131 | carries information about the file system automount points it |
132 | supervises. The options specific to the [Automount] section of | |
133 | automount units are the following:</para> | |
134 | ||
135 | <variablelist class='unit-directives'> | |
136 | ||
137 | <varlistentry> | |
138 | <term><varname>Where=</varname></term> | |
139 | <listitem><para>Takes an absolute path of a directory of the | |
140 | automount point. If the automount point does not exist at time | |
141 | that the automount point is installed, it is created. This | |
142 | string must be reflected in the unit filename. (See above.) | |
143 | This option is mandatory.</para></listitem> | |
144 | </varlistentry> | |
145 | ||
7c5cef22 AS |
146 | <varlistentry> |
147 | <term><varname>ExtraOptions=</varname></term> | |
148 | <listitem><para>Extra mount options to use when creating the autofs | |
149 | mountpoint. This takes a comma-separated list of options. This setting | |
150 | is optional. Note that the usual specifier expansion is applied to this | |
151 | setting, literal percent characters should hence be written as | |
ec07c3c8 AK |
152 | <literal class='specifiers'>%%</literal>.</para> |
153 | ||
154 | <xi:include href="version-info.xml" xpointer="v250"/></listitem> | |
7c5cef22 AS |
155 | </varlistentry> |
156 | ||
798d3a52 ZJS |
157 | <varlistentry> |
158 | <term><varname>DirectoryMode=</varname></term> | |
159 | <listitem><para>Directories of automount points (and any | |
160 | parent directories) are automatically created if needed. This | |
161 | option specifies the file system access mode used when | |
162 | creating these directories. Takes an access mode in octal | |
163 | notation. Defaults to 0755.</para></listitem> | |
164 | </varlistentry> | |
223a359f | 165 | |
deb0a77c MO |
166 | <varlistentry> |
167 | <term><varname>TimeoutIdleSec=</varname></term> | |
a8eaaee7 | 168 | <listitem><para>Configures an idle timeout. Once the mount has been |
deb0a77c MO |
169 | idle for the specified time, systemd will attempt to unmount. Takes a |
170 | unit-less value in seconds, or a time span value such as "5min 20s". | |
171 | Pass 0 to disable the timeout logic. The timeout is disabled by | |
ec07c3c8 AK |
172 | default.</para> |
173 | ||
174 | <xi:include href="version-info.xml" xpointer="v220"/></listitem> | |
deb0a77c | 175 | </varlistentry> |
798d3a52 | 176 | </variablelist> |
d8e1613e ZJS |
177 | |
178 | <xi:include href="systemd.service.xml" xpointer="shared-unit-options" /> | |
798d3a52 ZJS |
179 | </refsect1> |
180 | ||
181 | <refsect1> | |
182 | <title>See Also</title> | |
13a69c12 DT |
183 | <para><simplelist type="inline"> |
184 | <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
185 | <member><citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
186 | <member><citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
187 | <member><citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
188 | <member><citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
189 | <member><citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
190 | <member><citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> | |
191 | </simplelist></para> | |
798d3a52 | 192 | </refsect1> |
65232ea7 LP |
193 | |
194 | </refentry> |