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 | &lfs120_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 | </sect2>
|
---|
90 |
|
---|
91 | <sect2 role="kernel" id="autofs-kernel">
|
---|
92 | <title>Kernel Configuration</title>
|
---|
93 |
|
---|
94 | <indexterm zone="autofs autofs-kernel">
|
---|
95 | <primary sortas="d-Automounter">Automounter</primary>
|
---|
96 | </indexterm>
|
---|
97 |
|
---|
98 | <para>
|
---|
99 | Verify that automounter kernel support has been enabled:
|
---|
100 | </para>
|
---|
101 |
|
---|
102 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
103 | href="autofs-kernel.xml"/>
|
---|
104 |
|
---|
105 | <para>
|
---|
106 | Optionally, enable the following options in the kernel configuration:
|
---|
107 | </para>
|
---|
108 |
|
---|
109 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
110 | href="autofs-optional-kernel.xml"/>
|
---|
111 |
|
---|
112 | <para>
|
---|
113 | Recompile and install the new kernel, if necessary.
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | </sect2>
|
---|
117 |
|
---|
118 | <sect2 role="installation">
|
---|
119 |
|
---|
120 | <title>Installation of Autofs</title>
|
---|
121 |
|
---|
122 | <para>
|
---|
123 | First fix an issue introduced by glibc-2.36:
|
---|
124 | </para>
|
---|
125 |
|
---|
126 | <screen><userinput>grep -rl linux/fs modules | xargs sed -i "/linux\/fs/d"</userinput></screen>
|
---|
127 |
|
---|
128 | <para>
|
---|
129 | Install <application>Autofs</application> by running the following
|
---|
130 | commands:
|
---|
131 | </para>
|
---|
132 |
|
---|
133 | <screen revision="sysv"><userinput>./configure --prefix=/usr \
|
---|
134 | --with-mapdir=/etc/autofs \
|
---|
135 | --with-libtirpc \
|
---|
136 | --without-openldap \
|
---|
137 | --mandir=/usr/share/man &&
|
---|
138 | make</userinput></screen>
|
---|
139 |
|
---|
140 | <screen revision="systemd"><userinput>./configure --prefix=/usr \
|
---|
141 | --with-mapdir=/etc/autofs \
|
---|
142 | --with-libtirpc \
|
---|
143 | --with-systemd \
|
---|
144 | --without-openldap \
|
---|
145 | --mandir=/usr/share/man &&
|
---|
146 | make</userinput></screen>
|
---|
147 |
|
---|
148 | <para>
|
---|
149 | This package does not come with a test suite.
|
---|
150 | </para>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
154 | </para>
|
---|
155 |
|
---|
156 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
157 |
|
---|
158 | <!-- As of version 5.1.5, the configuration files are not installed anymore -->
|
---|
159 | <caution>
|
---|
160 | <para>
|
---|
161 | If <application>autofs</application> is already installed on your
|
---|
162 | system, be sure to backup your configuration files. They'll be
|
---|
163 | overwritten by the following command.
|
---|
164 | </para>
|
---|
165 | </caution>
|
---|
166 |
|
---|
167 | <para>
|
---|
168 | Install the default configuration files, still as the
|
---|
169 | <systemitem class="username">root</systemitem> user:
|
---|
170 | </para>
|
---|
171 |
|
---|
172 | <screen role="root"><userinput>make install_samples</userinput></screen>
|
---|
173 |
|
---|
174 | </sect2>
|
---|
175 |
|
---|
176 | <sect2 role="commands">
|
---|
177 | <title>Command Explanations</title>
|
---|
178 |
|
---|
179 | <para>
|
---|
180 | <parameter>--with-libtirpc</parameter>: This switch forces the package to
|
---|
181 | use libtirpc for RPC functionality instead of relying on implementation
|
---|
182 | from Glibc, which was removed in LFS 8.1.
|
---|
183 | </para>
|
---|
184 |
|
---|
185 | <para revision="systemd">
|
---|
186 | <parameter>--with-systemd</parameter>: This switch enables installation
|
---|
187 | of the bundled systemd units.
|
---|
188 | </para>
|
---|
189 |
|
---|
190 | <para>
|
---|
191 | <parameter>--without-openldap</parameter>: This switch disables openldap
|
---|
192 | if found. If openldap is desired, omit this switch. Note that openldap
|
---|
193 | support in autofs requires <xref linkend="mitkrb"/>.
|
---|
194 | </para>
|
---|
195 |
|
---|
196 | </sect2>
|
---|
197 |
|
---|
198 | <sect2 role="configuration">
|
---|
199 | <title>Configuring Autofs</title>
|
---|
200 |
|
---|
201 | <sect3 id="autofs-config">
|
---|
202 | <title>Config Files</title>
|
---|
203 |
|
---|
204 | <para>
|
---|
205 | <filename>/etc/sysconfig/autofs.conf</filename>,
|
---|
206 | <filename>/etc/autofs/auto.master</filename>,
|
---|
207 | <filename>/etc/autofs/auto.misc</filename>, and
|
---|
208 | <filename>/etc/autofs/auto.net</filename>
|
---|
209 | </para>
|
---|
210 |
|
---|
211 | <indexterm zone="autofs autofs-config" >
|
---|
212 | <primary sortas="e-etc-sysconfig-autofs.conf">/etc/sysconfig/autofs.conf</primary>
|
---|
213 | </indexterm>
|
---|
214 |
|
---|
215 | <indexterm zone="autofs autofs-config">
|
---|
216 | <primary sortas="e-etc-auto.master">/etc/autofs/auto.master</primary>
|
---|
217 | </indexterm>
|
---|
218 |
|
---|
219 | <indexterm zone="autofs autofs-config">
|
---|
220 | <primary sortas="e-etc-auto.misc">/etc/autofs/auto.misc</primary>
|
---|
221 | </indexterm>
|
---|
222 |
|
---|
223 | <indexterm zone="autofs autofs-config">
|
---|
224 | <primary sortas="e-etc-auto.net">/etc/autofs/auto.net</primary>
|
---|
225 | </indexterm>
|
---|
226 |
|
---|
227 | </sect3>
|
---|
228 |
|
---|
229 | <sect3>
|
---|
230 | <title>Configuration Information</title>
|
---|
231 |
|
---|
232 | <para>
|
---|
233 | The installation process creates <filename>auto.master</filename>,
|
---|
234 | <filename>auto.misc</filename>, <filename>auto.smb</filename>, and
|
---|
235 | <filename>auto.net</filename>. Replace the
|
---|
236 | <filename>auto.master</filename> file with the following commands
|
---|
237 | as the <systemitem class="username">root</systemitem> user:
|
---|
238 | </para>
|
---|
239 |
|
---|
240 | <screen role="root"><userinput>mv /etc/autofs/auto.master /etc/autofs/auto.master.bak &&
|
---|
241 | cat > /etc/autofs/auto.master << "EOF"
|
---|
242 | <literal># Begin /etc/autofs/auto.master
|
---|
243 |
|
---|
244 | /media/auto /etc/autofs/auto.misc --ghost
|
---|
245 | #/home /etc/autofs/auto.home
|
---|
246 |
|
---|
247 | # End /etc/autofs/auto.master</literal>
|
---|
248 | EOF</userinput></screen>
|
---|
249 |
|
---|
250 | <para>
|
---|
251 | This file creates a new media directory,
|
---|
252 | <filename>/media/auto</filename> that will overlay any existing
|
---|
253 | directory of the same name. In this example, the file,
|
---|
254 | <filename>/etc/autofs/auto.misc</filename>, has a line:
|
---|
255 | </para>
|
---|
256 |
|
---|
257 | <screen>cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom</screen>
|
---|
258 |
|
---|
259 | <para>
|
---|
260 | that will mount a cdrom as <filename>/media/auto/cd</filename> if
|
---|
261 | that directory is accessed. The <option>--ghost</option> option tells
|
---|
262 | the automounter to create <quote>ghost</quote> versions (i.e. empty
|
---|
263 | directories) of all the mount points listed in the configuration file
|
---|
264 | regardless whether any of the file systems are actually mounted or not.
|
---|
265 | This is very convenient and highly recommended, because it will show
|
---|
266 | you the available auto-mountable file systems as existing directories,
|
---|
267 | even when their file systems aren't currently mounted. Without the
|
---|
268 | <option>--ghost</option> option, you'll have to remember the names of
|
---|
269 | the directories. As soon as you try to access one of them, the
|
---|
270 | directory will be created and the file system will be mounted. When
|
---|
271 | the file system gets unmounted again, the directory is destroyed too,
|
---|
272 | unless the <option>--ghost</option> option was given.
|
---|
273 | </para>
|
---|
274 |
|
---|
275 | <note>
|
---|
276 | <para>
|
---|
277 | An alternative method would be to specify another automount
|
---|
278 | location such as <filename
|
---|
279 | class='directory'>/var/lib/auto/cdrom</filename> and create a
|
---|
280 | symbolic link from <filename
|
---|
281 | class='directory'>/media/cdrom</filename> to the automount location.
|
---|
282 | </para>
|
---|
283 | </note>
|
---|
284 |
|
---|
285 | <para>
|
---|
286 | The <filename>auto.misc</filename> file must be configured to your
|
---|
287 | working hardware. The loaded configuration file should load your cdrom
|
---|
288 | if <filename>/dev/cdrom</filename> is active or it can be edited to
|
---|
289 | match your device setup. Examples for floppies are available in the
|
---|
290 | file and easily activated. Documentation for this file is available
|
---|
291 | using the <command>man 5 autofs</command> command.
|
---|
292 | </para>
|
---|
293 |
|
---|
294 | <para>
|
---|
295 | In the second line, if enabled, a user's home directory would be
|
---|
296 | mounted via NFS upon login. The <filename>/etc/home.auto</filename>
|
---|
297 | would need to exist and have an entry similar to:
|
---|
298 | </para>
|
---|
299 |
|
---|
300 | <screen>joe example.org:/export/home/joe</screen>
|
---|
301 |
|
---|
302 | <para>
|
---|
303 | where the directory <filename>/export/home/joe</filename> is
|
---|
304 | exported via NFS from the system example.org. NFS shares
|
---|
305 | are covered on the next page.
|
---|
306 | </para>
|
---|
307 |
|
---|
308 | <para>
|
---|
309 | This package could also be used to mount SMB shares, however that
|
---|
310 | feature is not configured in these instructions. For additional
|
---|
311 | configuration information, see the man pages for auto.master(5). There
|
---|
312 | are also web resources such as this <ulink
|
---|
313 | url='https://wiki.gentoo.org/wiki/AutoFS'>AUTOFS
|
---|
314 | HOWTO</ulink> available.
|
---|
315 | </para>
|
---|
316 |
|
---|
317 | </sect3>
|
---|
318 |
|
---|
319 | <sect3 id="autofs-init">
|
---|
320 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
321 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
322 |
|
---|
323 | <para revision="sysv">
|
---|
324 | <application>autofs</application> installs its own
|
---|
325 | boot script, but it has no capability for logging or visual conformance
|
---|
326 | with other BLFS scripts. It will be replaced by an enhanced version.
|
---|
327 | </para>
|
---|
328 |
|
---|
329 | <para revision="sysv">
|
---|
330 | Install the <filename>/etc/init.d/autofs</filename>
|
---|
331 | mount script included with the <xref linkend="bootscripts"/>
|
---|
332 | package.
|
---|
333 | </para>
|
---|
334 |
|
---|
335 | <para revision="systemd">
|
---|
336 | To start <application>Autofs</application> at boot, enable the
|
---|
337 | previously installed systemd unit by running the following command as
|
---|
338 | the <systemitem class="username">root</systemitem> user:
|
---|
339 | </para>
|
---|
340 |
|
---|
341 | <indexterm zone="autofs autofs-init">
|
---|
342 | <primary sortas="f-autofs-init">autofs</primary>
|
---|
343 | </indexterm>
|
---|
344 |
|
---|
345 | <screen role="root" revision="sysv"><userinput>make install-autofs</userinput></screen>
|
---|
346 |
|
---|
347 | <screen role="root" revision="systemd"><userinput>systemctl enable autofs</userinput></screen>
|
---|
348 |
|
---|
349 | <para revision="sysv">
|
---|
350 | The time-out variable is set in
|
---|
351 | <filename>/etc/sysconfig/autofs.conf</filename>. The installed file sets
|
---|
352 | a default of 60 seconds of inactivity before unmounting the device. A
|
---|
353 | much shorter time may be necessary to protect buffer writing to a floppy
|
---|
354 | if users tend to remove the media prior to the timeout setting.
|
---|
355 | </para>
|
---|
356 |
|
---|
357 | <note revision="systemd">
|
---|
358 | <para>
|
---|
359 | You can also specify <envar>OPTIONS</envar> variable in the
|
---|
360 | <filename>/etc/sysconfig/autofs</filename> file with any additional
|
---|
361 | parameters that you might want to pass to the automount daemon.
|
---|
362 | </para>
|
---|
363 | </note>
|
---|
364 |
|
---|
365 | </sect3>
|
---|
366 |
|
---|
367 | </sect2>
|
---|
368 |
|
---|
369 | <sect2 role="content">
|
---|
370 | <title>Contents</title>
|
---|
371 |
|
---|
372 | <segmentedlist>
|
---|
373 | <segtitle>Installed Program</segtitle>
|
---|
374 | <segtitle>Installed Libraries</segtitle>
|
---|
375 | <segtitle>Installed Directories</segtitle>
|
---|
376 |
|
---|
377 | <seglistitem>
|
---|
378 | <seg>automount</seg>
|
---|
379 | <seg>
|
---|
380 | lookup_dir.so, lookup_file.so, lookup_files.so, lookup_hosts.so,
|
---|
381 | lookup_ldap.so (optional), lookup_multi.so, lookup_nis.so,
|
---|
382 | lookup_program.so, lookup_userhome.so, lookup_yp.so, mount_afs.so,
|
---|
383 | mount_autofs.so, mount_bind.so, mount_changer.so, mount_ext2.so,
|
---|
384 | mount_ext3.so, mount_ext4.so, mount_generic.so, mount_nfs.so,
|
---|
385 | mount_nfs4.so, parse_amd.so, and parse_sun.so
|
---|
386 | </seg>
|
---|
387 | <seg>/usr/lib/autofs and /etc/autofs</seg>
|
---|
388 | </seglistitem>
|
---|
389 | </segmentedlist>
|
---|
390 |
|
---|
391 | <variablelist>
|
---|
392 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
393 | <?dbfo list-presentation="list"?>
|
---|
394 | <?dbhtml list-presentation="table"?>
|
---|
395 |
|
---|
396 | <varlistentry id="automount">
|
---|
397 | <term><command>automount</command></term>
|
---|
398 | <listitem>
|
---|
399 | <para>
|
---|
400 | is the daemon that performs the mounting when a request is
|
---|
401 | made for the device
|
---|
402 | </para>
|
---|
403 | <indexterm zone="autofs automount">
|
---|
404 | <primary sortas="b-automount">automount</primary>
|
---|
405 | </indexterm>
|
---|
406 | </listitem>
|
---|
407 | </varlistentry>
|
---|
408 |
|
---|
409 | </variablelist>
|
---|
410 |
|
---|
411 | </sect2>
|
---|
412 |
|
---|
413 | </sect1>
|
---|