]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.automount.xml
test-hostname-util: add assert_se's to make coverity happy
[thirdparty/systemd.git] / man / systemd.automount.xml
CommitLineData
65232ea7 1<?xml version='1.0'?> <!--*-nxml-*-->
65232ea7 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
65232ea7
LP
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
65232ea7
LP
8 This file is part of systemd.
9
10 Copyright 2010 Lennart Poettering
11
12 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
65232ea7
LP
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 20 Lesser General Public License for more details.
65232ea7 21
5430f7f2 22 You should have received a copy of the GNU Lesser General Public License
65232ea7
LP
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24-->
25
26<refentry id="systemd.automount">
798d3a52
ZJS
27 <refentryinfo>
28 <title>systemd.automount</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd.automount</refentrytitle>
43 <manvolnum>5</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd.automount</refname>
48 <refpurpose>Automount unit configuration</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <para><filename><replaceable>automount</replaceable>.automount</filename></para>
53 </refsynopsisdiv>
54
55 <refsect1>
56 <title>Description</title>
57
58 <para>A unit configuration file whose name ends in
59 <literal>.automount</literal> encodes information about a file
60 system automount point controlled and supervised by
61 systemd.</para>
62
63 <para>This man page lists the configuration options specific to
64 this unit type. See
65 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
66 for the common options of all unit configuration files. The common
67 configuration items are configured in the generic [Unit] and
68 [Install] sections. The automount specific configuration options
69 are configured in the [Automount] section.</para>
70
f4bf8d2f
LP
71 <para>Automount units must be named after the automount directories they control. Example: the automount point
72 <filename noindex='true'>/home/lennart</filename> must be configured in a unit file
73 <filename>home-lennart.automount</filename>. For details about the escaping logic used to convert a file system
74 path to a unit name see
75 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note that
76 automount units cannot be templated, nor is it possible to add multiple names to an automount unit by creating
77 additional symlinks to its unit file.</para>
798d3a52
ZJS
78
79 <para>For each automount unit file a matching mount unit file (see
80 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
81 for details) must exist which is activated when the automount path
82 is accessed. Example: if an automount unit
83 <filename>home-lennart.automount</filename> is active and the user
84 accesses <filename>/home/lennart</filename> the mount unit
85 <filename>home-lennart.mount</filename> will be activated.</para>
86
87 <para>Automount units may be used to implement on-demand mounting
88 as well as parallelized mounting of file systems.</para>
c129bd5d
LP
89 </refsect1>
90
91 <refsect1>
45f09f93 92 <title>Implicit Dependencies</title>
c129bd5d 93
45f09f93 94 <para>The following dependencies are implicitly added:</para>
c129bd5d 95
45f09f93
JL
96 <itemizedlist>
97 <listitem><para>If an automount unit is beneath another mount unit in the
98 file system hierarchy, both a requirement and an ordering
99 dependency between both units are created automatically.</para></listitem>
c129bd5d 100
45f09f93
JL
101 <listitem><para>An implicit <varname>Before=</varname> dependency is created
102 between an automount unit and the mount unit it activates.</para></listitem>
103 </itemizedlist>
104 </refsect1>
105
106 <refsect1>
107 <title>Default Dependencies</title>
108
109 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
798d3a52 110
45f09f93
JL
111 <itemizedlist>
112 <listitem><para>Automount units acquire automatic <varname>Before=</varname> and
113 <varname>Conflicts=</varname> on <filename>umount.target</filename> in order to be stopped during
114 shutdown.</para></listitem>
115 </itemizedlist>
798d3a52
ZJS
116 </refsect1>
117
118 <refsect1>
119 <title><filename>fstab</filename></title>
120
121 <para>Automount units may either be configured via unit files, or
122 via <filename>/etc/fstab</filename> (see
3ba3a79d 123 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
798d3a52
ZJS
124 for details).</para>
125
126 <para>For details how systemd parses
127 <filename>/etc/fstab</filename> see
128 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
129
130 <para>If an automount point is configured in both
131 <filename>/etc/fstab</filename> and a unit file, the configuration
132 in the latter takes precedence.</para>
133 </refsect1>
134
135 <refsect1>
136 <title>Options</title>
137
138 <para>Automount files must include an [Automount] section, which
139 carries information about the file system automount points it
140 supervises. The options specific to the [Automount] section of
141 automount units are the following:</para>
142
143 <variablelist class='unit-directives'>
144
145 <varlistentry>
146 <term><varname>Where=</varname></term>
147 <listitem><para>Takes an absolute path of a directory of the
148 automount point. If the automount point does not exist at time
149 that the automount point is installed, it is created. This
150 string must be reflected in the unit filename. (See above.)
151 This option is mandatory.</para></listitem>
152 </varlistentry>
153
154 <varlistentry>
155 <term><varname>DirectoryMode=</varname></term>
156 <listitem><para>Directories of automount points (and any
157 parent directories) are automatically created if needed. This
158 option specifies the file system access mode used when
159 creating these directories. Takes an access mode in octal
160 notation. Defaults to 0755.</para></listitem>
161 </varlistentry>
deb0a77c
MO
162 <varlistentry>
163 <term><varname>TimeoutIdleSec=</varname></term>
a8eaaee7 164 <listitem><para>Configures an idle timeout. Once the mount has been
deb0a77c
MO
165 idle for the specified time, systemd will attempt to unmount. Takes a
166 unit-less value in seconds, or a time span value such as "5min 20s".
167 Pass 0 to disable the timeout logic. The timeout is disabled by
168 default.</para></listitem>
169 </varlistentry>
798d3a52
ZJS
170 </variablelist>
171 </refsect1>
172
173 <refsect1>
174 <title>See Also</title>
175 <para>
176 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
177 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
178 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
179 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
3ba3a79d
ZJS
180 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
181 <citerefentry project='die-net'><refentrytitle>automount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
798d3a52
ZJS
182 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
183 </para>
184 </refsect1>
65232ea7
LP
185
186</refentry>