]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.automount.xml
man: fix link markup
[thirdparty/systemd.git] / man / systemd.automount.xml
CommitLineData
65232ea7 1<?xml version='1.0'?> <!--*-nxml-*-->
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
65232ea7
LP
5
6<refentry id="systemd.automount">
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
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
bdac5608
ZJS
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>
798d3a52 41
f4bf8d2f 42 <para>Automount units must be named after the automount directories they control. Example: the automount point
b0343f8c 43 <filename index="false">/home/lennart</filename> must be configured in a unit file
f4bf8d2f
LP
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>
798d3a52
ZJS
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>
69876f94
CD
60
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>
c129bd5d
LP
66 </refsect1>
67
68 <refsect1>
aed5cb03 69 <title>Automatic Dependencies</title>
c129bd5d 70
aed5cb03
ZJS
71 <refsect2>
72 <title>Implicit Dependencies</title>
c129bd5d 73
aed5cb03 74 <para>The following dependencies are implicitly added:</para>
c129bd5d 75
aed5cb03
ZJS
76 <itemizedlist>
77 <listitem><para>If an automount unit is beneath another mount unit in the
78 file system hierarchy, both a requirement and an ordering
79 dependency between both units are created automatically.</para></listitem>
45f09f93 80
aed5cb03
ZJS
81 <listitem><para>An implicit <varname>Before=</varname> dependency is created
82 between an automount unit and the mount unit it activates.</para></listitem>
83 </itemizedlist>
84 </refsect2>
85
86 <refsect2>
87 <title>Default Dependencies</title>
45f09f93 88
aed5cb03 89 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
798d3a52 90
aed5cb03
ZJS
91 <itemizedlist>
92 <listitem><para>Automount units acquire automatic <varname>Before=</varname> and
93 <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
94 shutdown.</para></listitem>
b3d7aef5
FB
95
96 <listitem><para>Automount units automatically gain an <varname>After=</varname> dependency
97 on <filename>local-fs-pre.target</filename>, and a <varname>Before=</varname> dependency on
98 <filename>local-fs.target</filename>.</para></listitem>
aed5cb03
ZJS
99 </itemizedlist>
100 </refsect2>
798d3a52
ZJS
101 </refsect1>
102
103 <refsect1>
104 <title><filename>fstab</filename></title>
105
106 <para>Automount units may either be configured via unit files, or
107 via <filename>/etc/fstab</filename> (see
3ba3a79d 108 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
798d3a52
ZJS
109 for details).</para>
110
111 <para>For details how systemd parses
112 <filename>/etc/fstab</filename> see
113 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
114
115 <para>If an automount point is configured in both
116 <filename>/etc/fstab</filename> and a unit file, the configuration
117 in the latter takes precedence.</para>
118 </refsect1>
119
120 <refsect1>
121 <title>Options</title>
122
123 <para>Automount files must include an [Automount] section, which
124 carries information about the file system automount points it
125 supervises. The options specific to the [Automount] section of
126 automount units are the following:</para>
127
128 <variablelist class='unit-directives'>
129
130 <varlistentry>
131 <term><varname>Where=</varname></term>
132 <listitem><para>Takes an absolute path of a directory of the
133 automount point. If the automount point does not exist at time
134 that the automount point is installed, it is created. This
135 string must be reflected in the unit filename. (See above.)
136 This option is mandatory.</para></listitem>
137 </varlistentry>
138
139 <varlistentry>
140 <term><varname>DirectoryMode=</varname></term>
141 <listitem><para>Directories of automount points (and any
142 parent directories) are automatically created if needed. This
143 option specifies the file system access mode used when
144 creating these directories. Takes an access mode in octal
145 notation. Defaults to 0755.</para></listitem>
146 </varlistentry>
deb0a77c
MO
147 <varlistentry>
148 <term><varname>TimeoutIdleSec=</varname></term>
a8eaaee7 149 <listitem><para>Configures an idle timeout. Once the mount has been
deb0a77c
MO
150 idle for the specified time, systemd will attempt to unmount. Takes a
151 unit-less value in seconds, or a time span value such as "5min 20s".
152 Pass 0 to disable the timeout logic. The timeout is disabled by
153 default.</para></listitem>
154 </varlistentry>
798d3a52
ZJS
155 </variablelist>
156 </refsect1>
157
158 <refsect1>
159 <title>See Also</title>
160 <para>
161 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
162 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
163 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
164 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
3ba3a79d
ZJS
165 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
166 <citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52
ZJS
167 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
168 </para>
169 </refsect1>
65232ea7
LP
170
171</refentry>