glfs/general/sysutils/autofs.xml
Bruce Dubbs 9e9cd2a279 Update book title and copyright date.
Remove portmap and nfs-utils at least until upstream gets their act together.
Stable NIS and NFS headers and functions not currently available from any
source.



git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8950 af4574ff-66df-0310-9fd7-8a98e5e911e0
2011-11-09 17:37:35 +00:00

317 lines
12 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY autofs-patch-dir "http://ftp.kernel.org/pub/linux/daemons/autofs/v5">
<!ENTITY autofs-download-http "http://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-&autofs-version;.tar.bz2">
<!ENTITY autofs-download-ftp "ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-&autofs-version;.tar.bz2">
<!ENTITY autofs-md5sum "a1d262cb6ebef0c2dd0fe22232fb3d5a">
<!ENTITY autofs-size "295 KB">
<!ENTITY autofs-buildsize "5.3 MB">
<!ENTITY autofs-time "0.1 SBU">
]>
<sect1 id="autofs" xreflabel="Autofs-&autofs-version;">
<?dbhtml filename="autofs.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>autofs-&autofs-version;</title>
<indexterm zone="autofs">
<primary sortas="a-Autofs">Autofs</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to Autofs</title>
<para>The <application>Autofs</application> package contains userspace
tools that work with the kernel to mount and un-mount removable file
systems. The primary use is to mount external network file systems like
<!-- NFS (see <xref linkend="nfs-utils"/>) or -->Samba (see <xref linkend="samba3"/>)
on demand.</para>
<para>It may also be useful for allowing users to mount floppies, cdroms and
other removable storage devices without requiring the system
administrator to mount the devices although this capability is now generally
provided by HAL (see <xref linkend="hal"/>). This may not be ideal for all
installations, so be aware of the risks before implementing this feature.</para>
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <ulink url="&autofs-download-http;"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url="&autofs-download-ftp;"/></para>
</listitem>
<listitem>
<para>Download MD5 sum: &autofs-md5sum;</para>
</listitem>
<listitem>
<para>Download size: &autofs-size;</para>
</listitem>
<listitem>
<para>Estimated disk space required: &autofs-buildsize;</para>
</listitem>
<listitem>
<para>Estimated build time: &autofs-time;</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
<para>Recommended Patches: There are frequent patches issued for
<application>Autofs</application>. One method you can use to get the
current patches requires first installing the <xref linkend="wget"/>
package. After ensuring the <command>wget</command> command is installed
in a directory identified in the <envar>PATH</envar> variable, start in
the same directory as the main tar file and issue the following
commands:</para>
<screen><userinput>wget &autofs-patch-dir;/patch_order-&autofs-version; &amp;&amp;
sed 's;autofs;&autofs-patch-dir;/autofs;' \
patch_order-&autofs-version; | grep -v ^# &gt; wget-list &amp;&amp;
wget -i wget-list</userinput></screen>
<note><para>As of this writing, the patch list contains one patch
labelled as from the 5.0.4 series of patches.</para></note>
<bridgehead renderas="sect3">Autofs Dependencies</bridgehead>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional"><xref linkend="openldap"/> and
<xref linkend="cyrus-sasl"/></para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/autofs"/></para>
</sect2>
<sect2 role="kernel" id="autofs-kernel">
<title>Kernel Configuration</title>
<indexterm zone="autofs autofs-kernel">
<primary sortas="d-Automounter">Automounter</primary>
</indexterm>
<para>Verify that kernel support has been compiled in or built as
modules in the following areas:</para>
<screen><literal>File systems &rArr;
Kernel automounter version 4 support Y or M
Network File Systems &rArr;
NFS client support Y or M (optional)
CIFS support Y or M (optional)</literal></screen>
<para>Recompile and install the new kernel, if necessary.</para>
</sect2>
<sect2 role="installation">
<title>Installation of Autofs</title>
<para>Install <application>Autofs</application> by running the following
commands:</para>
<screen><userinput>for f in `cat ../patch_order-&autofs-version;`; do
patch -Np1 -i ../$f
done &amp;&amp;
./configure --prefix=/ --mandir=/usr/share/man &amp;&amp;
make</userinput></screen>
<para>This package does not come with a test suite.</para>
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
<screen role="root"><userinput>make install &amp;&amp;
ln -sf ../init.d/autofs /etc/rc.d/rcsysinit.d/S52autofs</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para><command>for f in `cat ../patch_order-&autofs-version;`; do
patch -Np1 -i ../$f; done</command>: This command applies all the
patches downloaded earlier in the correct order.</para>
<para><command>ln -sf ../init.d/autofs
/etc/rc.d/rcsysinit.d/S52autofs</command>: This command sets the
link to properly start autofs upon boot.</para>
</sect2>
<sect2 role="configuration">
<title>Configuring Autofs</title>
<sect3 id="autofs-config">
<title>Config Files</title>
<para><filename>/etc/sysconfig/autofs.conf</filename>,
<filename>/etc/auto.master</filename>,
<filename>/etc/auto.misc</filename>, and
<filename>/etc/auto.net</filename></para>
<indexterm zone="autofs autofs-config" >
<primary sortas="e-etc-sysconfig-autofs.conf">/etc/sysconfig/autofs.conf</primary>
</indexterm>
<indexterm zone="autofs autofs-config">
<primary sortas="e-etc-auto.master">/etc/auto.master</primary>
</indexterm>
<indexterm zone="autofs autofs-config">
<primary sortas="e-etc-auto.misc">/etc/auto.misc</primary>
</indexterm>
<indexterm zone="autofs autofs-config">
<primary sortas="e-etc-auto.net">/etc/auto.net</primary>
</indexterm>
</sect3>
<sect3>
<title>Configuration Information</title>
<para>The installation process creates <filename>auto.master</filename>,
<filename>auto.misc</filename>, <filename>auto.smb</filename>, and
<filename>auto.net</filename>. Replace the
<filename>auto.master</filename> file with the following commands:</para>
<screen role="root"><userinput>mv /etc/auto.master /etc/auto.master.bak &amp;&amp;
cat &gt; /etc/auto.master &lt;&lt; "EOF"
<literal># Begin /etc/auto.master
/media/auto /etc/auto.misc --ghost
#/home /etc/auto.home
# End /etc/auto.master</literal>
EOF</userinput></screen>
<para>This file creates a new media directory, <filename>/media/auto</filename>
that will overlay any existing directory of the same name. In this example,
the file, <filename>/etc/auto.misc</filename>, has a line:</para>
<screen>cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom</screen>
<para>that will mount a cdrom as <filename>/media/auto/cd</filename> if
that directory is accessed. The <option>--ghost</option> option tells
the automounter to create <quote>ghost</quote> versions (i.e. empty
directories) of all the mount points listed in the configuration file
regardless whether any of the file systems are actually mounted or not.
This is very convenient and highly recommended, because it will show you
the available auto-mountable file systems as existing directories, even
when their file systems aren't currently mounted. Without the
<option>--ghost</option> option, you'll have to remember the names of the
directories. As soon as you try to access one of them, the directory will
be created and the file system will be mounted. When the file system gets
unmounted again, the directory is destroyed too, unless the
<option>--ghost</option> option was given.</para>
<note>
<para>An alternative method would be to specify another automount
location such as <filename
class='directory'>/var/lib/auto/cdrom</filename> and create a
symbolic link from <filename class='directory'>/media/cdrom</filename>
to the automount location.</para>
</note>
<para>The <filename>auto.misc</filename> file must be configured to your
working hardware. The loaded configuration file should load your cdrom
if <filename>/dev/cdrom</filename> is active or it can be edited to
match your device setup. Examples for floppies are available in the file
and easily activated. Documentation for this file is available using the
<command>man 5 autofs</command> command.</para>
<para>In the second line, if enabled, a user's home directory would be
mounted via NFS upon login. The <filename>/etc/home.auto</filename>
would need to exist and have an entry similar to:</para>
<screen>joe example.org:/export/home/joe</screen>
<para>where the directory <filename>/export/home/joe</filename> is
exported via NFS from the system example.org. NFS shares
are covered on the next page.</para>
<para>This package could also be used to mount SMB shares, however that
feature is not configured in these instructions. For additional
configuration information, see the man pages for auto.master(5). There
are also web resources such as this <ulink
url='http://en.gentoo-wiki.com/wiki/Autofs'>AUTOFS
HOWTO</ulink> available.</para>
</sect3>
<!--
<sect3 id="autofs-init">
<title>Boot Script</title>
<para>Install the <filename>/etc/rc.d/init.d/autofs</filename> mount script
and <filename>/etc/sysconfig/autofs.conf</filename> support file included
with the <xref linkend="bootscripts"/> package.</para>
<indexterm zone="autofs autofs-init">
<primary sortas="f-autofs-init">autofs</primary>
</indexterm>
<screen role="root"><userinput>make install-autofs</userinput></screen>
<para>The time-out variable is set in
<filename>/etc/sysconfig/autofs.conf</filename>. The installed file sets
a default of 60 seconds of inactivity before unmounting the device. A
much shorter time may be necessary to protect buffer writing to a floppy
if users tend to remove the media prior to the timeout setting.</para>
</sect3>
-->
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Program</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>automount</seg>
<seg>lookup_file.so, lookup_hosts.so, lookup_multi.so,
lookup_nisplus.so, lookup_program.so, lookup_userhome.so,
lookup_yp.so, mount_afs.so, mount_autofs.so, mount_bind.so,
mount_changer.so, mount_ext2.so, mount_generic.so,
mount_nfs.so, parse_sun.so</seg>
<seg>/lib/autofs and /var/run/autofs</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="automount">
<term><command>automount</command></term>
<listitem>
<para>is the daemon that performs the mounting when a request is
made for the device.</para>
<indexterm zone="autofs automount">
<primary sortas="b-automount">automount</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>