Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with autofs / auto.net / nfs.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nvergottini
n00b
n00b


Joined: 18 Jul 2004
Posts: 1

PostPosted: Sun Jul 18, 2004 6:49 am    Post subject: Problems with autofs / auto.net / nfs. Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum