]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.automount.xml
Merge pull request #15661 from hundeboll/mount-read-write-only
[thirdparty/systemd.git] / man / systemd.automount.xml
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+ -->
5
6 <refentry id="systemd.automount">
7 <refentryinfo>
8 <title>systemd.automount</title>
9 <productname>systemd</productname>
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
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
32 systemd.</para>
33
34 <para>This man page lists the configuration options specific to
35 this unit type. See
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 <literal>[Unit]</literal> and
39 <literal>[Install]</literal> sections. The automount specific configuration options
40 are configured in the <literal>[Automount]</literal> section.</para>
41
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>
49
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>
57
58 <para>Automount units may be used to implement on-demand mounting
59 as well as parallelized mounting of file systems.</para>
60 </refsect1>
61
62 <refsect1>
63 <title>Automatic Dependencies</title>
64
65 <refsect2>
66 <title>Implicit Dependencies</title>
67
68 <para>The following dependencies are implicitly added:</para>
69
70 <itemizedlist>
71 <listitem><para>If an automount unit is beneath another mount unit in the
72 file system hierarchy, both a requirement and an ordering
73 dependency between both units are created automatically.</para></listitem>
74
75 <listitem><para>An implicit <varname>Before=</varname> dependency is created
76 between an automount unit and the mount unit it activates.</para></listitem>
77 </itemizedlist>
78 </refsect2>
79
80 <refsect2>
81 <title>Default Dependencies</title>
82
83 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
84
85 <itemizedlist>
86 <listitem><para>Automount units acquire automatic <varname>Before=</varname> and
87 <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
88 shutdown.</para></listitem>
89
90 <listitem><para>Automount units automatically gain an <varname>After=</varname> dependency
91 on <filename>local-fs-pre.target</filename>, and a <varname>Before=</varname> dependency on
92 <filename>local-fs.target</filename>.</para></listitem>
93 </itemizedlist>
94 </refsect2>
95 </refsect1>
96
97 <refsect1>
98 <title><filename>fstab</filename></title>
99
100 <para>Automount units may either be configured via unit files, or
101 via <filename>/etc/fstab</filename> (see
102 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
103 for details).</para>
104
105 <para>For details how systemd parses
106 <filename>/etc/fstab</filename> see
107 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
108
109 <para>If an automount point is configured in both
110 <filename>/etc/fstab</filename> and a unit file, the configuration
111 in the latter takes precedence.</para>
112 </refsect1>
113
114 <refsect1>
115 <title>Options</title>
116
117 <para>Automount files must include an [Automount] section, which
118 carries information about the file system automount points it
119 supervises. The options specific to the [Automount] section of
120 automount units are the following:</para>
121
122 <variablelist class='unit-directives'>
123
124 <varlistentry>
125 <term><varname>Where=</varname></term>
126 <listitem><para>Takes an absolute path of a directory of the
127 automount point. If the automount point does not exist at time
128 that the automount point is installed, it is created. This
129 string must be reflected in the unit filename. (See above.)
130 This option is mandatory.</para></listitem>
131 </varlistentry>
132
133 <varlistentry>
134 <term><varname>DirectoryMode=</varname></term>
135 <listitem><para>Directories of automount points (and any
136 parent directories) are automatically created if needed. This
137 option specifies the file system access mode used when
138 creating these directories. Takes an access mode in octal
139 notation. Defaults to 0755.</para></listitem>
140 </varlistentry>
141 <varlistentry>
142 <term><varname>TimeoutIdleSec=</varname></term>
143 <listitem><para>Configures an idle timeout. Once the mount has been
144 idle for the specified time, systemd will attempt to unmount. Takes a
145 unit-less value in seconds, or a time span value such as "5min 20s".
146 Pass 0 to disable the timeout logic. The timeout is disabled by
147 default.</para></listitem>
148 </varlistentry>
149 </variablelist>
150 </refsect1>
151
152 <refsect1>
153 <title>See Also</title>
154 <para>
155 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
156 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
157 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
158 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
159 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
160 <citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
161 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
162 </para>
163 </refsect1>
164
165 </refentry>