nvergottini n00b
Joined: 18 Jul 2004 Posts: 1
|
Posted: Sun Jul 18, 2004 6:49 am Post subject: Problems with autofs / auto.net / nfs. |
|
|
I'm trying to get an auto.net script obtained from Fedora Core 2 to work with autofs in Gentoo. This script works perfectly in Fedora, but I'm having no luck in Gentoo. Here's the script:
Code: | #!/bin/sh
# $Id: auto.net,v 1.5 2003/09/29 08:22:35 raven Exp $
# Look at what a host is exporting to determine what we can mount.
# This is very simple, but it appears to work surprisingly well
key="$1"
# add "nosymlink" here if you want to suppress symlinking local filesystems
# add "nonstrict" to make it OK for some filesystems to not mount
opts="-fstype=nfs,hard,intr,nodev,nosuid"
# Showmount comes in a number of names and varieties. "showmount" is
# typically an older version which accepts the '--no-headers' flag
# but ignores it. "kshowmount" is the newer version installed with knfsd,
# which both accepts and acts on the '--no-headers' flag.
#SHOWMOUNT="kshowmount --no-headers -e $key"
#SHOWMOUNT="showmount -e $key | tail +2"
# Newer distributions get this right
SHOWMOUNT="/usr/sbin/showmount --no-headers -e $key"
$SHOWMOUNT | sort +0 | \
awk -v key="$key" -v opts="$opts" -- '
BEGIN { ORS=""; first=1 }
{ if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 }
END { if (!first) print "\n"; else exit 1 }
'
|
When used as the map file for /net in my auto.master file, the script should allow me to mount the NFS exports on any server simply my navigating to /net/myserver. When I do, however, I get "No such file or directory".
I do have autofs4 compiled as a module in my kernel, autofs is aliased to autofs4, the auto.net script is marked executable, and when I run it, it does give the correct output:
Code: | mydesktop autofs # ./auto.net myserver
-fstype=nfs,hard,intr,nodev,nosuid \
/var/www/mysite myserver:/var/www/mysite
|
When I start autofs and attempt to cd to /net/myserver, here's what I see in my log:
Quote: | Jul 18 02:37:55 mydesktop automount[16240]: starting automounter version 3.1.7, path = /net, maptype = program, mapname = /etc/autofs/auto.net
Jul 18 02:37:55 mydesktop automount[16240]: Map argc = 1
Jul 18 02:37:55 mydesktop automount[16240]: Map argv[0] = /etc/autofs/auto.net
Jul 18 02:37:55 mydesktop automount[16240]: mount(bind): Testing if "mount --bind" works correctly...
Jul 18 02:37:55 mydesktop automount[16240]: mount(bind): calling mount --bind /tmp/autofs-bind-40fa28d3-3f70/dir1 /tmp/autofs-bind-40fa28d3-3f70/dir2
Jul 18 02:37:55 mydesktop automount[16240]: using kernel protocol version 3
Jul 18 02:38:01 mydesktop automount[16240]: attempting to mount entry /net/myserver
Jul 18 02:38:01 mydesktop automount[16272]: lookup(program): looking up myserver
Jul 18 02:38:01 mydesktop automount[16272]: lookup(program): myserver -> -fstype=nfs,hard,intr,nodev,nosuid \
Jul 18 02:38:01 mydesktop automount[16272]: expanded entry: -fstype=nfs,hard,intr,nodev,nosuid
Jul 18 02:38:01 mydesktop automount[16272]: parse(sun): gathered options: fstype=nfs,hard,intr,nodev,nosuid
|
Has anyone had any success doing this or have any suggestions as to what I might be missing.
Neil |
|