1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY autofs-download-http "&kernel-dl;/linux/daemons/autofs/v5/autofs-&autofs-version;.tar.xz">
|
---|
8 | <!ENTITY autofs-download-ftp " ">
|
---|
9 | <!ENTITY autofs-md5sum "72d81645d39a857c3d16bd3a32e9cb44">
|
---|
10 | <!ENTITY autofs-size "320 KB">
|
---|
11 | <!ENTITY autofs-buildsize "6.5 MB">
|
---|
12 | <!ENTITY autofs-time "0.1 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="autofs" xreflabel="Autofs-&autofs-version;">
|
---|
16 | <?dbhtml filename="autofs.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>autofs-&autofs-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="autofs">
|
---|
22 | <primary sortas="a-Autofs">Autofs</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to Autofs</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | <application>Autofs</application> controls the operation of the automount
|
---|
30 | daemons. The automount daemons automatically mount filesystems when they
|
---|
31 | are accessed and unmount them after a period of inactivity. This is done
|
---|
32 | based on a set of pre-configured maps.
|
---|
33 | </para>
|
---|
34 |
|
---|
35 | &lfs113_checked;
|
---|
36 |
|
---|
37 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
38 | <itemizedlist spacing="compact">
|
---|
39 | <listitem>
|
---|
40 | <para>
|
---|
41 | Download (HTTP): <ulink url="&autofs-download-http;"/>
|
---|
42 | </para>
|
---|
43 | </listitem>
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (FTP): <ulink url="&autofs-download-ftp;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download MD5 sum: &autofs-md5sum;
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download size: &autofs-size;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Estimated disk space required: &autofs-buildsize;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated build time: &autofs-time;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | </itemizedlist>
|
---|
70 |
|
---|
71 | <bridgehead renderas="sect3">Autofs Dependencies</bridgehead>
|
---|
72 |
|
---|
73 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
74 | <para role="required">
|
---|
75 | <xref linkend="libtirpc"/> and
|
---|
76 | <xref linkend="rpcsvc-proto"/>
|
---|
77 | </para>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
80 | <para role="optional">
|
---|
81 | <xref linkend="nfs-utils"/>,
|
---|
82 | <xref linkend="libnsl"/>,
|
---|
83 | <xref linkend="libxml2"/>,
|
---|
84 | <xref linkend="mitkrb"/>,
|
---|
85 | <xref linkend="openldap"/> (client only), and
|
---|
86 | <xref linkend="cyrus-sasl"/>
|
---|
87 | </para>
|
---|
88 |
|
---|
89 | <para condition="html" role="usernotes">User Notes:
|
---|
90 | <ulink url="&blfs-wiki;/autofs"/></para>
|
---|
91 |
|
---|
92 | </sect2>
|
---|
93 |
|
---|
94 | <sect2 role="kernel" id="autofs-kernel">
|
---|
95 | <title>Kernel Configuration</title>
|
---|
96 |
|
---|
97 | <indexterm zone="autofs autofs-kernel">
|
---|
98 | <primary sortas="d-Automounter">Automounter</primary>
|
---|
99 | </indexterm>
|
---|
100 |
|
---|
101 | <para>
|
---|
102 | Verify that automounter kernel support has been enabled:
|
---|
103 | </para>
|
---|
104 |
|
---|
105 | <screen><literal>File systems --->
|
---|
106 | <*/M> Kernel automounter support (supports v3, v4, and v5) [CONFIG_AUTOFS_FS]</literal></screen>
|
---|
107 |
|
---|
108 | <para>
|
---|
109 | Optionally, enable the following options in the kernel configuration:
|
---|
110 | </para>
|
---|
111 |
|
---|
112 | <screen><literal>File systems --->
|
---|
113 | [*] Network File Systems ---> [CONFIG_NETWORK_FILESYSTEMS]
|
---|
114 | <*/M> NFS client support [CONFIG_NFS_FS]
|
---|
115 | <*/M> SMB3 and CIFS support (advanced network filesystem) [CONFIG_CIFS]</literal></screen>
|
---|
116 |
|
---|
117 | <para>
|
---|
118 | Recompile and install the new kernel, if necessary.
|
---|
119 | </para>
|
---|
120 |
|
---|
121 | </sect2>
|
---|
122 |
|
---|
123 | <sect2 role="installation">
|
---|
124 |
|
---|
125 | <title>Installation of Autofs</title>
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | First fix an issue introduced by glibc-2.36:
|
---|
129 | </para>
|
---|
130 |
|
---|
131 | <screen><userinput>grep -rl linux/fs modules | xargs sed -i "/linux\/fs/d"</userinput></screen>
|
---|
132 |
|
---|
133 | <para>
|
---|
134 | Install <application>Autofs</application> by running the following
|
---|
135 | commands:
|
---|
136 | </para>
|
---|
137 |
|
---|
138 | <screen revision="sysv"><userinput>./configure --prefix=/usr \
|
---|
139 | --with-mapdir=/etc/autofs \
|
---|
140 | --with-libtirpc \
|
---|
141 | --without-openldap \
|
---|
142 | --mandir=/usr/share/man &&
|
---|
143 | make</userinput></screen>
|
---|
144 |
|
---|
145 | <screen revision="systemd"><userinput>./configure --prefix=/usr \
|
---|
146 | --with-mapdir=/etc/autofs \
|
---|
147 | --with-libtirpc \
|
---|
148 | --with-systemd \
|
---|
149 | --without-openldap \
|
---|
150 | --mandir=/usr/share/man &&
|
---|
151 | make</userinput></screen>
|
---|
152 |
|
---|
153 | <para>
|
---|
154 | This package does not come with a test suite.
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | <para>
|
---|
158 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
159 | </para>
|
---|
160 |
|
---|
161 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
162 |
|
---|
163 | <!-- As of version 5.1.5, the configuration files are not installed anymore -->
|
---|
164 | <caution>
|
---|
165 | <para>
|
---|
166 | If <application>autofs</application> is already installed on your
|
---|
167 | system, be sure to backup your configuration files. They'll be
|
---|
168 | overwritten by the following command.
|
---|
169 | </para>
|
---|
170 | </caution>
|
---|
171 |
|
---|
172 | <para>
|
---|
173 | Install the default configuration files, still as the
|
---|
174 | <systemitem class="username">root</systemitem> user:
|
---|
175 | </para>
|
---|
176 |
|
---|
177 | <screen role="root"><userinput>make install_samples</userinput></screen>
|
---|
178 |
|
---|
179 | </sect2>
|
---|
180 |
|
---|
181 | <sect2 role="commands">
|
---|
182 | <title>Command Explanations</title>
|
---|
183 |
|
---|
184 | <para>
|
---|
185 | <parameter>--with-libtirpc</parameter>: This switch forces the package to
|
---|
186 | use libtirpc for RPC functionality instead of relying on implementation
|
---|
187 | from Glibc, which was removed in LFS 8.1.
|
---|
188 | </para>
|
---|
189 |
|
---|
190 | <para revision="systemd">
|
---|
191 | <parameter>--with-systemd</parameter>: This switch enables installation
|
---|
192 | of the bundled systemd units.
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <para>
|
---|
196 | <parameter>--without-openldap</parameter>: This switch disables openldap
|
---|
197 | if found. If openldap is desired, omit this switch. Note that openldap
|
---|
198 | support in autofs requires <xref linkend="mitkrb"/>.
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | </sect2>
|
---|
202 |
|
---|
203 | <sect2 role="configuration">
|
---|
204 | <title>Configuring Autofs</title>
|
---|
205 |
|
---|
206 | <sect3 id="autofs-config">
|
---|
207 | <title>Config Files</title>
|
---|
208 |
|
---|
209 | <para>
|
---|
210 | <filename>/etc/sysconfig/autofs.conf</filename>,
|
---|
211 | <filename>/etc/autofs/auto.master</filename>,
|
---|
212 | <filename>/etc/autofs/auto.misc</filename>, and
|
---|
213 | <filename>/etc/autofs/auto.net</filename>
|
---|
214 | </para>
|
---|
215 |
|
---|
216 | <indexterm zone="autofs autofs-config" >
|
---|
217 | <primary sortas="e-etc-sysconfig-autofs.conf">/etc/sysconfig/autofs.conf</primary>
|
---|
218 | </indexterm>
|
---|
219 |
|
---|
220 | <indexterm zone="autofs autofs-config">
|
---|
221 | <primary sortas="e-etc-auto.master">/etc/autofs/auto.master</primary>
|
---|
222 | </indexterm>
|
---|
223 |
|
---|
224 | <indexterm zone="autofs autofs-config">
|
---|
225 | <primary sortas="e-etc-auto.misc">/etc/autofs/auto.misc</primary>
|
---|
226 | </indexterm>
|
---|
227 |
|
---|
228 | <indexterm zone="autofs autofs-config">
|
---|
229 | <primary sortas="e-etc-auto.net">/etc/autofs/auto.net</primary>
|
---|
230 | </indexterm>
|
---|
231 |
|
---|
232 | </sect3>
|
---|
233 |
|
---|
234 | <sect3>
|
---|
235 | <title>Configuration Information</title>
|
---|
236 |
|
---|
237 | <para>
|
---|
238 | The installation process creates <filename>auto.master</filename>,
|
---|
239 | <filename>auto.misc</filename>, <filename>auto.smb</filename>, and
|
---|
240 | <filename>auto.net</filename>. Replace the
|
---|
241 | <filename>auto.master</filename> file with the following commands
|
---|
242 | as the <systemitem class="username">root</systemitem> user:
|
---|
243 | </para>
|
---|
244 |
|
---|
245 | <screen role="root"><userinput>mv /etc/autofs/auto.master /etc/autofs/auto.master.bak &&
|
---|
246 | cat > /etc/autofs/auto.master << "EOF"
|
---|
247 | <literal># Begin /etc/autofs/auto.master
|
---|
248 |
|
---|
249 | /media/auto /etc/autofs/auto.misc --ghost
|
---|
250 | #/home /etc/autofs/auto.home
|
---|
251 |
|
---|
252 | # End /etc/autofs/auto.master</literal>
|
---|
253 | EOF</userinput></screen>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | This file creates a new media directory,
|
---|
257 | <filename>/media/auto</filename> that will overlay any existing
|
---|
258 | directory of the same name. In this example, the file,
|
---|
259 | <filename>/etc/autofs/auto.misc</filename>, has a line:
|
---|
260 | </para>
|
---|
261 |
|
---|
262 | <screen>cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom</screen>
|
---|
263 |
|
---|
264 | <para>
|
---|
265 | that will mount a cdrom as <filename>/media/auto/cd</filename> if
|
---|
266 | that directory is accessed. The <option>--ghost</option> option tells
|
---|
267 | the automounter to create <quote>ghost</quote> versions (i.e. empty
|
---|
268 | directories) of all the mount points listed in the configuration file
|
---|
269 | regardless whether any of the file systems are actually mounted or not.
|
---|
270 | This is very convenient and highly recommended, because it will show
|
---|
271 | you the available auto-mountable file systems as existing directories,
|
---|
272 | even when their file systems aren't currently mounted. Without the
|
---|
273 | <option>--ghost</option> option, you'll have to remember the names of
|
---|
274 | the directories. As soon as you try to access one of them, the
|
---|
275 | directory will be created and the file system will be mounted. When
|
---|
276 | the file system gets unmounted again, the directory is destroyed too,
|
---|
277 | unless the <option>--ghost</option> option was given.
|
---|
278 | </para>
|
---|
279 |
|
---|
280 | <note>
|
---|
281 | <para>
|
---|
282 | An alternative method would be to specify another automount
|
---|
283 | location such as <filename
|
---|
284 | class='directory'>/var/lib/auto/cdrom</filename> and create a
|
---|
285 | symbolic link from <filename
|
---|
286 | class='directory'>/media/cdrom</filename> to the automount location.
|
---|
287 | </para>
|
---|
288 | </note>
|
---|
289 |
|
---|
290 | <para>
|
---|
291 | The <filename>auto.misc</filename> file must be configured to your
|
---|
292 | working hardware. The loaded configuration file should load your cdrom
|
---|
293 | if <filename>/dev/cdrom</filename> is active or it can be edited to
|
---|
294 | match your device setup. Examples for floppies are available in the
|
---|
295 | file and easily activated. Documentation for this file is available
|
---|
296 | using the <command>man 5 autofs</command> command.
|
---|
297 | </para>
|
---|
298 |
|
---|
299 | <para>
|
---|
300 | In the second line, if enabled, a user's home directory would be
|
---|
301 | mounted via NFS upon login. The <filename>/etc/home.auto</filename>
|
---|
302 | would need to exist and have an entry similar to:
|
---|
303 | </para>
|
---|
304 |
|
---|
305 | <screen>joe example.org:/export/home/joe</screen>
|
---|
306 |
|
---|
307 | <para>
|
---|
308 | where the directory <filename>/export/home/joe</filename> is
|
---|
309 | exported via NFS from the system example.org. NFS shares
|
---|
310 | are covered on the next page.
|
---|
311 | </para>
|
---|
312 |
|
---|
313 | <para>
|
---|
314 | This package could also be used to mount SMB shares, however that
|
---|
315 | feature is not configured in these instructions. For additional
|
---|
316 | configuration information, see the man pages for auto.master(5). There
|
---|
317 | are also web resources such as this <ulink
|
---|
318 | url='https://wiki.gentoo.org/wiki/AutoFS'>AUTOFS
|
---|
319 | HOWTO</ulink> available.
|
---|
320 | </para>
|
---|
321 |
|
---|
322 | </sect3>
|
---|
323 |
|
---|
324 | <sect3 id="autofs-init">
|
---|
325 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
326 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
327 |
|
---|
328 | <para revision="sysv">
|
---|
329 | <application>autofs</application> installs its own
|
---|
330 | boot script, but it has no capability for logging or visual conformance
|
---|
331 | with other BLFS scripts. It will be replaced by an enhanced version.
|
---|
332 | </para>
|
---|
333 |
|
---|
334 | <para revision="sysv">
|
---|
335 | Install the <filename>/etc/init.d/autofs</filename>
|
---|
336 | mount script included with the <xref linkend="bootscripts"/>
|
---|
337 | package.
|
---|
338 | </para>
|
---|
339 |
|
---|
340 | <para revision="systemd">
|
---|
341 | To start <application>Autofs</application> at boot, enable the
|
---|
342 | previously installed systemd unit by running the following command as
|
---|
343 | the <systemitem class="username">root</systemitem> user:
|
---|
344 | </para>
|
---|
345 |
|
---|
346 | <indexterm zone="autofs autofs-init">
|
---|
347 | <primary sortas="f-autofs-init">autofs</primary>
|
---|
348 | </indexterm>
|
---|
349 |
|
---|
350 | <screen role="root" revision="sysv"><userinput>make install-autofs</userinput></screen>
|
---|
351 |
|
---|
352 | <screen role="root" revision="systemd"><userinput>systemctl enable autofs</userinput></screen>
|
---|
353 |
|
---|
354 | <para revision="sysv">
|
---|
355 | The time-out variable is set in
|
---|
356 | <filename>/etc/sysconfig/autofs.conf</filename>. The installed file sets
|
---|
357 | a default of 60 seconds of inactivity before unmounting the device. A
|
---|
358 | much shorter time may be necessary to protect buffer writing to a floppy
|
---|
359 | if users tend to remove the media prior to the timeout setting.
|
---|
360 | </para>
|
---|
361 |
|
---|
362 | <note revision="systemd">
|
---|
363 | <para>
|
---|
364 | You can also specify <envar>OPTIONS</envar> variable in the
|
---|
365 | <filename>/etc/sysconfig/autofs</filename> file with any additional
|
---|
366 | parameters that you might want to pass to the automount daemon.
|
---|
367 | </para>
|
---|
368 | </note>
|
---|
369 |
|
---|
370 | </sect3>
|
---|
371 |
|
---|
372 | </sect2>
|
---|
373 |
|
---|
374 | <sect2 role="content">
|
---|
375 | <title>Contents</title>
|
---|
376 |
|
---|
377 | <segmentedlist>
|
---|
378 | <segtitle>Installed Program</segtitle>
|
---|
379 | <segtitle>Installed Libraries</segtitle>
|
---|
380 | <segtitle>Installed Directories</segtitle>
|
---|
381 |
|
---|
382 | <seglistitem>
|
---|
383 | <seg>automount</seg>
|
---|
384 | <seg>
|
---|
385 | lookup_dir.so, lookup_file.so, lookup_files.so, lookup_hosts.so,
|
---|
386 | lookup_ldap.so (optional), lookup_multi.so, lookup_nis.so,
|
---|
387 | lookup_program.so, lookup_userhome.so, lookup_yp.so, mount_afs.so,
|
---|
388 | mount_autofs.so, mount_bind.so, mount_changer.so, mount_ext2.so,
|
---|
389 | mount_ext3.so, mount_ext4.so, mount_generic.so, mount_nfs.so,
|
---|
390 | mount_nfs4.so, parse_amd.so, and parse_sun.so
|
---|
391 | </seg>
|
---|
392 | <seg>/usr/lib/autofs and /etc/autofs</seg>
|
---|
393 | </seglistitem>
|
---|
394 | </segmentedlist>
|
---|
395 |
|
---|
396 | <variablelist>
|
---|
397 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
398 | <?dbfo list-presentation="list"?>
|
---|
399 | <?dbhtml list-presentation="table"?>
|
---|
400 |
|
---|
401 | <varlistentry id="automount">
|
---|
402 | <term><command>automount</command></term>
|
---|
403 | <listitem>
|
---|
404 | <para>
|
---|
405 | is the daemon that performs the mounting when a request is
|
---|
406 | made for the device
|
---|
407 | </para>
|
---|
408 | <indexterm zone="autofs automount">
|
---|
409 | <primary sortas="b-automount">automount</primary>
|
---|
410 | </indexterm>
|
---|
411 | </listitem>
|
---|
412 | </varlistentry>
|
---|
413 |
|
---|
414 | </variablelist>
|
---|
415 |
|
---|
416 | </sect2>
|
---|
417 |
|
---|
418 | </sect1>
|
---|