]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.automount.xml
namespace: implicitly adds DeviceAllow= when RootImage= is set
[thirdparty/systemd.git] / man / systemd.automount.xml
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">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="systemd.automount">
10 <refentryinfo>
11 <title>systemd.automount</title>
12 <productname>systemd</productname>
13 </refentryinfo>
14
15 <refmeta>
16 <refentrytitle>systemd.automount</refentrytitle>
17 <manvolnum>5</manvolnum>
18 </refmeta>
19
20 <refnamediv>
21 <refname>systemd.automount</refname>
22 <refpurpose>Automount unit configuration</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <para><filename><replaceable>automount</replaceable>.automount</filename></para>
27 </refsynopsisdiv>
28
29 <refsect1>
30 <title>Description</title>
31
32 <para>A unit configuration file whose name ends in
33 <literal>.automount</literal> encodes information about a file
34 system automount point controlled and supervised by
35 systemd.</para>
36
37 <para>This man page lists the configuration options specific to
38 this unit type. See
39 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
40 for the common options of all unit configuration files. The common
41 configuration items are configured in the generic [Unit] and
42 [Install] sections. The automount specific configuration options
43 are configured in the [Automount] section.</para>
44
45 <para>Automount units must be named after the automount directories they control. Example: the automount point
46 <filename noindex='true'>/home/lennart</filename> must be configured in a unit file
47 <filename>home-lennart.automount</filename>. For details about the escaping logic used to convert a file system
48 path to a unit name see
49 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note that
50 automount units cannot be templated, nor is it possible to add multiple names to an automount unit by creating
51 additional symlinks to its unit file.</para>
52
53 <para>For each automount unit file a matching mount unit file (see
54 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
55 for details) must exist which is activated when the automount path
56 is accessed. Example: if an automount unit
57 <filename>home-lennart.automount</filename> is active and the user
58 accesses <filename>/home/lennart</filename> the mount unit
59 <filename>home-lennart.mount</filename> will be activated.</para>
60
61 <para>Automount units may be used to implement on-demand mounting
62 as well as parallelized mounting of file systems.</para>
63 </refsect1>
64
65 <refsect1>
66 <title>Automatic Dependencies</title>
67
68 <refsect2>
69 <title>Implicit Dependencies</title>
70
71 <para>The following dependencies are implicitly added:</para>
72
73 <itemizedlist>
74 <listitem><para>If an automount unit is beneath another mount unit in the
75 file system hierarchy, both a requirement and an ordering
76 dependency between both units are created automatically.</para></listitem>
77
78 <listitem><para>An implicit <varname>Before=</varname> dependency is created
79 between an automount unit and the mount unit it activates.</para></listitem>
80 </itemizedlist>
81 </refsect2>
82
83 <refsect2>
84 <title>Default Dependencies</title>
85
86 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
87
88 <itemizedlist>
89 <listitem><para>Automount units acquire automatic <varname>Before=</varname> and
90 <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
91 shutdown.</para></listitem>
92 </itemizedlist>
93 </refsect2>
94 </refsect1>
95
96 <refsect1>
97 <title><filename>fstab</filename></title>
98
99 <para>Automount units may either be configured via unit files, or
100 via <filename>/etc/fstab</filename> (see
101 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
102 for details).</para>
103
104 <para>For details how systemd parses
105 <filename>/etc/fstab</filename> see
106 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
107
108 <para>If an automount point is configured in both
109 <filename>/etc/fstab</filename> and a unit file, the configuration
110 in the latter takes precedence.</para>
111 </refsect1>
112
113 <refsect1>
114 <title>Options</title>
115
116 <para>Automount files must include an [Automount] section, which
117 carries information about the file system automount points it
118 supervises. The options specific to the [Automount] section of
119 automount units are the following:</para>
120
121 <variablelist class='unit-directives'>
122
123 <varlistentry>
124 <term><varname>Where=</varname></term>
125 <listitem><para>Takes an absolute path of a directory of the
126 automount point. If the automount point does not exist at time
127 that the automount point is installed, it is created. This
128 string must be reflected in the unit filename. (See above.)
129 This option is mandatory.</para></listitem>
130 </varlistentry>
131
132 <varlistentry>
133 <term><varname>DirectoryMode=</varname></term>
134 <listitem><para>Directories of automount points (and any
135 parent directories) are automatically created if needed. This
136 option specifies the file system access mode used when
137 creating these directories. Takes an access mode in octal
138 notation. Defaults to 0755.</para></listitem>
139 </varlistentry>
140 <varlistentry>
141 <term><varname>TimeoutIdleSec=</varname></term>
142 <listitem><para>Configures an idle timeout. Once the mount has been
143 idle for the specified time, systemd will attempt to unmount. Takes a
144 unit-less value in seconds, or a time span value such as "5min 20s".
145 Pass 0 to disable the timeout logic. The timeout is disabled by
146 default.</para></listitem>
147 </varlistentry>
148 </variablelist>
149 </refsect1>
150
151 <refsect1>
152 <title>See Also</title>
153 <para>
154 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
155 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
156 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
157 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
158 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
159 <citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
160 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
161 </para>
162 </refsect1>
163
164 </refentry>