On Tue, 18 Oct 2005, Rainer Krienke wrote:
> using the autofs package from suse10.0 (autofs-4.1.4-6.i586.rpm; autofs4
> kernel module, Kernel2.6.13-15) NFS mounts of user directories fail ...
> In auto.home there is this entry for each user like "krienke":
>
> krienke localhost:/import/user2/krienke
>
> In auto.vol you find another entry to handle the "user2" key starting at
> /import from above
> (there are more than one nfsservers exporting user1, user2, ... each with
> about 2000 users):
>
> user2 nfssrv2:/export/user2
> Oct 18 12:42:30 rzinstal1 automount[16793]: aquire_lock: can't lock lock file
> timed out: /var/lock/autofs
Now that's a very neat solution to the problem of too many incoming /
outgoing mounts. But unfortunately you're doing the following sequence:
User refers to /home/krienke
Autofs starts to mount /import/homesite/fsys/krienke, stats
/import/homesite/fsys
Second autofs thread starts to mount homesite:/export/fsys
Oops, an autofs thread has the lock, 2nd thread either blocks
waiting for the lock, or dies. (The latter, judging from
timestamps.)
The ideal is for autofs to avoid the deadlock by itself, but for a quick
fix I'd put a programmatic map on /home which would do the NIS lookup by
itself to ascertain which is the home site, would pre-mount
/import/homesite/filesys (using the automounter, by statting the
filesystem root), then would emit a map row pointing to the actual homedir.
I've attached my auto.net programmatic map. Our issues are different from
yours, but some of the issues are similar enough that portions of the
program could be copied.
James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Email: [EMAIL PROTECTED] http://www.math.ucla.edu/~jimc (q.v. for PGP key)#!/bin/sh
# Equivalent of the "hosts" map on Sun's automounter.
# Copyright (c) 2001 by The Regents of the University of California
# Author: Jim Carter, UCLA-Mathnet <[EMAIL PROTECTED]>, 2001-08-23
# This is an executable map file, mounted on /net. When the automounter
# sees /net/$host/restof/path, it runs this script with $1 = hostname.
# This program does automagical setup, then emits a map line directing
# attention to /rete/$host, on which it has mounted a separate automount
# process which takes it from there. Since the referent is on the local
# host, the /net automounter emits a symbolic link or does a "bind" mount,
# which is efficient.
# Specify -d for debug mode.
if [ X$1 != X-d ] ; then
# If you want to customize the name of the secondary mount directory
rete=/rete
# Minimum time in minutes between purging unused host processes
purgetime=60
# autobase is the basename of the automount program
autobase=automount
else
shift
opt_d=DEBUG
rete=./rete
purgetime=1
autobase=sleep
fi
# Idiotproof for testing
if [ -z "$1" ] ; then
echo "Usage: $0 hostname (hostname required)" 1>&2
fi
# Purge unused host-specific map files. This occurs
# at most once an hour.
# find: -mmin is true if the file's mtime is N minutes old.
stamp=`find $rete/TIMESTAMP -mmin -$purgetime -print 2> /dev/null`
if [ -z "$stamp" ] ; then
mkdir $rete/KEEP
for f in /net/* ; do
bn=`basename $f`
if [ -f "$rete/$bn" ] ; then mv "$rete/$bn" $rete/KEEP ; fi
done
rm -f $rete/[a-z]*
mv $rete/KEEP/* $rete 2> /dev/null
rmdir $rete/KEEP
date "+host map files last purged at %Y-%m-%d %H:%M:%S" > $rete/TIMESTAMP
fi
# Create map file for the host-specific automount process.
echo "* $1:/&" > $rete/$1
# Emit map row to cause an autofs submount to be spawned.
# Resulting command line is:
# /usr/sbin/automount --submount /net/$1 file $rete/$1
# followed by map options if any were specified.
echo "-rsize=8192,wsize=8192,retry=1,soft,fstype=autofs file:$rete/$1"
exit 0
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs