> I've seen the page at linux consulting, and copied the submount example.
  > But the mount attempts hang, with nothing in the log. The timeout
  > doesn't occur either - it just sits there.
  > Any ideas?

Make sure that you have a "/usr/lib/autofs/mount_autofs.so" around to
handle the "-fstype=autofs" submounts.  My SuSE 6.1 installation left
that out (along with a couple of other types).  I believe I did get
a log message, though.  Also make sure your submount files are not
marked executable, unless you are intentionally using "program" maps
(in which case, read on).

I had a terrible time getting submounts working, partly because of the
above, but mostly because I tried to use program maps, and took quite
a while to realize the docs were wrong.

    A map can be marked as executable.  The init  script  that
    parses the auto.master map will pass this as a program map
    to the automounter.  A program map will  be  called  as  a
    script  with  the key as an argument.  The script needs to
    return one line of a map or no output at all  if  the  key
           ^^^^^^^^^^^^^^^^^
    cannot be matched.

Actually, in current versions the key field must be left out, or
symlink chaos ensues.  Here is what I am using to get as much mileage
as possible from an in-house Solaris direct-style NIS map:

==== auto.master ==========================================================
#
# Autofs automount master map
#
# To pick up changes, use:
#      /etc/rc.d/init.d/autofs stop && /etc/rc.d/init.d/autofs start
#
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
#
/misc   /etc/auto.misc
/disks  /etc/auto.org_exports
===========================================================================

==== auto.org_exports =====================================================
#!/bin/sh
#
# make direct map from NIS usable by current Linux autofs.

echo "$0: $1" >> /tmp/autoout

ypc=/usr/bin/ypcat

[ -x "$ypc" ] || exit 0

if $ypc -k auto.exports | grep -e '^/disks/'"$1" 2>&1 >/dev/null; then
        echo '-fstype=autofs' "program:/etc/auto.org_exports_sub"
fi
===========================================================================

==== auto.org_exports_sub =================================================
#!/bin/sh
#
#

echo "$0: $1" >> /tmp/autoout

ypm=/usr/bin/ypmatch

[ -x "$ypm" ] || exit 0

# relying on `pwd` seems a little bold...
# If we use "-k" we really go to jail. UTSM trumps RTFM here. 
exec $ypm `pwd`/$1 auto.exports 2>/dev/null 
===========================================================================

This allows me to get to a bunch of in-house filesystems without
wasting too much time when I run into now-nonexistent /disks/*/* mounts
via symlinks.  I don't get the nice browsing of available mounts that
Solaris gives me with "cd /disks && ls", though.  Sigh.


Mark Carmichael                       "Adobe's phone bill, my opinions."

Reply via email to