Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355263 - net-fs/autofs-5.0.5 fails to parse output from /etc/auto.net
Summary: net-fs/autofs-5.0.5 fails to parse output from /etc/auto.net
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Stefaan De Roeck (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 22:47 UTC by Xake
Modified: 2011-03-01 12:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xake 2011-02-16 22:47:12 UTC
I have a nfs4-fileserver, and want to be able to reach it by just "ls -l /net/liten.local/srv".
The problem is that even when /etc/auto.net gives nfs4 as filesystem, automount fails to parse the options, resulting in automount trying to sned mount.nfs the default (i.e. nfs) fstype which fails.

In the following output, take special note on "lookup_mount: lookup(hosts):" and also what fstype /etc/auto.net shows compared to what mount.nfs are being sent.

lillen ~ # /etc/auto.net liten.local
-fstype=nfs4,hard,intr,nodev,nosuid \
	/srv liten.local:/srv
lillen ~ # automount -d -f /etc/auto.master 
Starting automounter version 5.0.5, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
parse_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /net
lookup_nss_read_master: reading master file /etc/auto.master
parse_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /net
ignoring duplicate indirect mount /net
master_do_mount: mounting /net
automount_path_to_fifo: fifo name /var/run/autofs.fifo-net
lookup_nss_read_map: reading map hosts (null)
parse_init: parse(sun): init gathered global options: (null)
mounted indirect on /net with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /net
handle_packet: type = 3
handle_packet_missing_indirect: token 15, name liten.local, request pid 14146
attempting to mount entry /net/liten.local
lookup_mount: lookup(hosts): fetchng export list for liten.local
lookup_mount: lookup(hosts): liten.local -> "/srv" "liten.local:/srv"
parse_mount: parse(sun): expanded entry: "/srv" "liten.local:/srv"
parse_mount: parse(sun): gathered options: 
parse_mount: parse(sun): dequote(""/srv"") -> /srv
parse_mapent: parse(sun): gathered options: 
parse_mapent: parse(sun): dequote(""liten.local:/srv"") -> liten.local:/srv
add_offset_entry: parse(sun): added multi-mount offset /srv -> liten.local:/srv
mount_multi_triggers: mount offset /net/liten.local/srv at /net/liten.local
mount_autofs_offset: calling mount -t autofs -s  -o fd=7,pgrp=14136,minproto=5,maxproto=5,offset automount /net/liten.local/srv
mounted offset on /net/liten.local/srv with timeout 300, freq 75 seconds
mount_autofs_offset: mounted trigger /net/liten.local/srv at /net/liten.local/srv
dev_ioctl_send_ready: token = 15
mounted /net/liten.local
handle_packet: type = 5
handle_packet_missing_direct: token 16, name /net/liten.local/srv, request pid 14146
attempting to mount entry /net/liten.local/srv
lookup_mount: lookup(hosts): /net/liten.local/srv -> liten.local:/srv
parse_mount: parse(sun): expanded entry: liten.local:/srv
parse_mount: parse(sun): gathered options: 
sun_mount: parse(sun): mounting root /tmp/autoxa72mw, mountpoint /net/liten.local/srv, what liten.local:/srv, fstype nfs, options nosuid,nodev,intr
mount_mount: mount(nfs): root=/tmp/autoxa72mw name=/net/liten.local/srv what=liten.local:/srv, fstype=nfs, options=nosuid,nodev,intr
mount_mount: mount(nfs): nfs options="nosuid,nodev,intr", nosymlink=0, ro=0
mount_mount: mount(nfs): calling mkdir_path /tmp/autoxa72mw
mount_mount: mount(nfs): calling mount -t nfs -s -o nosuid,nodev,intr liten.local:/srv /tmp/autoxa72mw
>> mount.nfs: Protocol not supported
mount(nfs): nfs: mount failure liten.local:/srv on /tmp/autoxa72mw
dev_ioctl_send_fail: token = 16
failed to mount /net/liten.local/srv
handle_packet: type = 5
handle_packet_missing_direct: token 17, name /net/liten.local/srv, request pid 14146
attempting to mount entry /net/liten.local/srv
dev_ioctl_send_fail: token = 17
failed to mount /net/liten.local/srv


Looking closer at it it seems like the problem is in the lookup_mount routine for "host". If you compare to "file" which in this case is for the following configure:
/etc/auto.master: /imports /etc/auto.imports
/etc/auto.imports: liten	-fstype=nfs4,rw,soft,timeout=30	liten.local:/

This configuration gives the following output:

handle_packet: type = 3
handle_packet_missing_indirect: token 29, name liten, request pid 14310
attempting to mount entry /imports/liten
lookup_mount: lookup(file): looking up liten
lookup_mount: lookup(file): liten -> -fstype=nfs4,rw,soft,timeout=30	liten.local:/
parse_mount: parse(sun): expanded entry: -fstype=nfs4,rw,soft,timeout=30	liten.local:/
parse_mount: parse(sun): gathered options: fstype=nfs4,rw,soft,timeout=30
parse_mount: parse(sun): dequote("liten.local:/") -> liten.local:/
parse_mount: parse(sun): core of entry: options=fstype=nfs4,rw,soft,timeout=30, loc=liten.local:/
sun_mount: parse(sun): mounting root /imports, mountpoint liten, what liten.local:/, fstype nfs4, options rw,soft
mount_mount: mount(nfs): root=/imports name=liten what=liten.local:/, fstype=nfs4, options=rw,soft
mount_mount: mount(nfs): nfs options="rw,soft", nosymlink=0, ro=0
mount_mount: mount(nfs): calling mkdir_path /imports/liten
mount_mount: mount(nfs): calling mount -t nfs4 -s -o rw,soft liten.local:/ /imports/liten
mount(nfs): mounted liten.local:/ on /imports/liten
dev_ioctl_send_ready: token = 29
mounted /imports/liten
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-18 14:05:41 UTC
Please paste your `emerge --info' output in a comment.
Comment 2 Dustin Polke 2011-02-18 14:33:18 UTC
Please provide as well the following information:
1a) Is '/etc/init.d/autofs' service running?
1b) If it is not running, does starting this service help?
2) Have you set protocol accordingly to use nfs4 in /etc/conf.d/autofs?
3) Please attach the involved configuration files to this bug as I can hardly follow what is in which file.
Comment 3 Xake 2011-02-18 16:53:34 UTC
(In reply to comment #1)
> Please paste your `emerge --info' output in a comment.
> 

Portage 2.2.0_alpha24 (hardened/linux/amd64, gcc-4.5.2, glibc-2.12.2-r0, 2.6.38-rc5+ x86_64)
=================================================================
System uname: Linux-2.6.38-rc5+-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 17 Feb 2011 07:30:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.4 [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1, 3.1.3
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo gamerlay-stable x11 mozilla Mine
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -ggdb -mtune=native"
DISTDIR="/var/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.sunet.se/pub/os/Linux/distributions/gentoo"
LANG="sv_SE.UTF-8"
LC_ALL="C"
LDFLAGS="-Wl,--as-needed -Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu"
LINGUAS="sv en"
MAKEOPTS="-j16 -l15"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/overlays/layman/gamerlay /var/overlays/layman/x11 /var/overlays/layman/mozilla /var/overlays/mine"
SYNC="rsync://liten.csbnet.se/gentoo-portage"
USE="X a52 aac accessibility acl acpi alsa amd64 amr amrnb amrwb applet archive asyncns autoipd avahi bash-completion bluetooth branding bzip2 cairo caps ccache cdaudio cdda cdr cleartype cli clutter connection-sharing consolekit coverart cracklib crypt cups cxx dbus device-mapper devicekit devkit dhcpcd digitalradio djvu dri dts dvd dvdr dvi eds enca encode eselect evo exif fat fbcondecor ffmpeg fftw flac fluidsynth fontconfig fuse gdbm gdm gdu gif gimp glib gmp gnome gnome-keyring gphoto2 gpm grammar graphite gsf gsm gstreamer gtk gudev hardened hpn ical iconv iconvacl icq icu id3tag idn ieee1394 iptc ipv6 jabber jack java6 jingle jpeg jpeg2k justify kate kvm lcms libffi libnotify libsamplerate logrotate lvm lzma mad maps math matroska md mdadm midi mms mmx mmxext mng moonlight mp2 mp3 mpeg mpfr mpi msn mtp mudflap multilib musepack musicbrainz natspec nautilus ncurses network-cron networkmanager nfs nls nntp nptl nptlonly ntfs ntp nut offensive ogg openal opencore-amr opengl openmp openntpd ots pam pango parted pcre pdf perl pic pidgin playlist png policykit pppd pulseaudio python qt3support quicktime quvi raw readline rrdcgi rtmp samba schroedinger seed sensord session smp sms speex spell sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs test tex theora thesaurus threads tiff totem truetype udev unicode upnp urandom usb userlocales v4l2 vaapi vhook videos vim-syntax vorbis webkit wmf x264 xattr xcb xcomposite xml xmp xmpp xorg xrandr xscreensaver xulrunner xv xvid xvmc zeroconf zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="sv en" NETBEANS_MODULES="cnd profiler dlight harness ide java websvccommon apisupport nb" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


(In reply to comment #2)
> Please provide as well the following information:
> 1a) Is '/etc/init.d/autofs' service running?
Eh, I ran the service by hand in the same way as the initscript does, because I needed the "-d" option for output

> 1b) If it is not running, does starting this service help?
No, because it has the same problem, and adding -d to the initscript shows the same fault in the logs.

> 2) Have you set protocol accordingly to use nfs4 in /etc/conf.d/autofs?
Makes no difference, same faults in logs.

> 3) Please attach the involved configuration files to this bug as I can hardly
> follow what is in which file.
> 

The configuration I am trying is the exact same as shipped with autofs.
"emerge autofs && /etc/init.d/autofs start && ls -l /net/<hostame>/<sharename>" is supposed to mount and show the exported directory in question, by using /etc/auto.net to lookup the host and what shares it exports.
Changing the default in /etc/conf.d/autofs gives the same message (which indicates that it still tries to mount nfs3).
Changing the default fstype in /etc/auto.net from nfs to nfs4 changes nothing too, since as shown in c# 1 this is not parsed to begin with.
I could go through what the different with autofs shipped config-files are supposed to do if you need a refresh.



A nf4 working configuration for my setup I can obtain by:
echo /imports /etc/auto.imports >> /etc/auto.master && \
echo liten \-fstype=nfs4 liten.local:/ && \
/etc/init.d/autofs reload && \
ls -l /imports/liten/srv
Comment 4 Dustin Polke 2011-02-18 20:08:56 UTC
Thanks for the info, I will have a look asap.
Comment 5 Dustin Polke 2011-02-28 13:09:17 UTC
I had a thorough look at your problem. As I understood your problem is:

1) You have the following entry in your auto.master config file:
'/net    /etc/autofs/auto.net'

2) You have configured your nfs server to export a directory which is not '/'.

3) You have changed the fstype in auto.net to be '-fstype=nfs4'

4) Accessing files of the export via /net/<server>/<share> fails.

Please check whether above mentioned is describing your setup corrrectly.
If I described your setup correctly, then unfortunately I can't do anything about the situation.
Have a look at the following thread on upstream's mailing list: http://thread.gmane.org/gmane.linux.kernel.autofs/5824/

If your issue is different from above mentioned, please let me know what I missed and I will have a look again.
Comment 6 Xake 2011-02-28 18:46:18 UTC
(In reply to comment #5)
> I had a thorough look at your problem. As I understood your problem is:
> 
> 1) You have the following entry in your auto.master config file:
> '/net    /etc/autofs/auto.net'
> 
> 2) You have configured your nfs server to export a directory which is not '/'.
> 
> 3) You have changed the fstype in auto.net to be '-fstype=nfs4'
> 
> 4) Accessing files of the export via /net/<server>/<share> fails.
> 
> Please check whether above mentioned is describing your setup corrrectly.

Yes, it does
I have also as stated tried with MOUNT_NFS_DEFAULT_PROTOCOL=4 which did not help either.

> If I described your setup correctly, then unfortunately I can't do anything
> about the situation.

Why? Point 3 (i.e. autofs does not parse the options set in auto.net) is at least according to documentation a bug.
Also, should not MOUNT_NFS_DEFAULT_PROTOCOL=4 at least try to force nfsv4 first, before trying nfsv3?

> Have a look at the following thread on upstream's mailing list:
> http://thread.gmane.org/gmane.linux.kernel.autofs/5824/
> 
> If your issue is different from above mentioned, please let me know what I
> missed and I will have a look again.
> 

Well, I do not think this is the same issue.

Also that issue is from RedHat, and RedHat is based on fedora, right?
On my Fedora14 box (same configuration files as in Gentoo out of the box):
[xake@meddli ~]$ ls -l /net/liten.local/srv
totalt 56
drwxrwxr-x.  16 1000  413  4096 19 feb 09.59 ftp
drwxr-xr-x.   4 1000  413  4096 12 okt  2009 git
drwx------.   2 root root 16384 29 apr  2010 lost+found


However on my Gentoo box:
xake@lillen ~ $ ls -l /net/liten.local/srv
ls: /net/liten.local/srv: Filen eller katalogen finns inte
ls: kan inte öppna katalog /net/liten.local/srv: Filen eller katalogen finns inte
(i.e. The file or directory does not exist)
Comment 7 Dustin Polke 2011-03-01 09:07:58 UTC
(In reply to comment #6)
> > Have a look at the following thread on upstream's mailing list:
> > http://thread.gmane.org/gmane.linux.kernel.autofs/5824/
> > 
> > If your issue is different from above mentioned, please let me know what I
> > missed and I will have a look again.
> > 
> 
> Well, I do not think this is the same issue.
Okay. I was able to reproduce the situation mentioned above, so I was pretty sure this is same.
> 
> Also that issue is from RedHat, and RedHat is based on fedora, right?
> On my Fedora14 box (same configuration files as in Gentoo out of the box):
> [xake@meddli ~]$ ls -l /net/liten.local/srv
> totalt 56
> drwxrwxr-x.  16 1000  413  4096 19 feb 09.59 ftp
> drwxr-xr-x.   4 1000  413  4096 12 okt  2009 git
> drwx------.   2 root root 16384 29 apr  2010 lost+found

That's really good news as we can use this box to find out what's different to the Gentoo install.
If you are willing to help me, I'd be really happy as I don't have access to a Fedora box.
 
> However on my Gentoo box:
> xake@lillen ~ $ ls -l /net/liten.local/srv
> ls: /net/liten.local/srv: Filen eller katalogen finns inte
> ls: kan inte öppna katalog /net/liten.local/srv: Filen eller katalogen finns
> inte
> (i.e. The file or directory does not exist)
Yes, that's what I get on my test setup as well when using nfs4 to access an export which is not '/' and set fsid=0 property in /etc/exports.
Using nfs3 the mount is successful. This is exactly what is discussed on mentioned upstream's mailing list.

To start further examination, could you please provide
1) relevant entry of `/etc/exports` on liten.local providing the export
2) output of `showmount -e liten.local`
3) diff of auto.net between Fedora and Gentoo install (if there is any)

Comment 8 Xake 2011-03-01 10:06:24 UTC
(In reply to comment #7)
> That's really good news as we can use this box to find out what's different to
> the Gentoo install.
> If you are willing to help me, I'd be really happy as I don't have access to a
> Fedora box.
> 

I am willing to help.

> > However on my Gentoo box:
> > xake@lillen ~ $ ls -l /net/liten.local/srv
> > ls: /net/liten.local/srv: Filen eller katalogen finns inte
> > ls: kan inte öppna katalog /net/liten.local/srv: Filen eller katalogen finns
> > inte
> > (i.e. The file or directory does not exist)
> Yes, that's what I get on my test setup as well when using nfs4 to access an
> export which is not '/' and set fsid=0 property in /etc/exports.
> Using nfs3 the mount is successful. This is exactly what is discussed on
> mentioned upstream's mailing list.
> 

No matter if I have fsid set or not, it does not difference.

> To start further examination, could you please provide
> 1) relevant entry of `/etc/exports` on liten.local providing the export
This is the only entry
/srv 192.168.0.0/255.255.0.0(rw,no_subtree_check,async)
> 2) output of `showmount -e liten.local`
$ showmount -e liten.local
Export list for liten.local:
/srv 192.168.0.0/255.255.0.0
(same on both Gentoo and Fedora)
> 3) diff of auto.net between Fedora and Gentoo install (if there is any)
> 
No differences, both seems to be the upstream provided.
Comment 9 Xake 2011-03-01 11:10:47 UTC
Ok, after taking another look at my setup I found out some things I should have done differently, and for some reason fedora "just handled".

What I can say is that there is a bug in autofs upstream, namely that it ignores the options set in /etc/auto.net
But my problem was probably local, which makes this bug to noisy to track the actual bug.
Comment 10 Dustin Polke 2011-03-01 11:31:13 UTC
(In reply to comment #9)
> Ok, after taking another look at my setup I found out some things I should have
> done differently, and for some reason fedora "just handled".
If you like to explain what the problem was, it would be great if Gentoo as well 'just handles' this :-)
> 
> What I can say is that there is a bug in autofs upstream, namely that it
> ignores the options set in /etc/auto.net
Well, for me it does not. If I put -fstype=nfs4, I get 'File not found' error when having a an export not referring to / but deeper in the tree. This is due to the fact that 'showmount -e' will give you the full path to the export in the tree like /foo/bar/baz. With nfs4, you will not access this export under /net/<server>/foo/bar/baz but /net/<server>/baz.
Exporting / results in a valid nfs4 mount for me.
Comment 11 Xake 2011-03-01 12:17:22 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > Ok, after taking another look at my setup I found out some things I should have
> > done differently, and for some reason fedora "just handled".
> If you like to explain what the problem was, it would be great if Gentoo as
> well 'just handles' this :-)

For some reason the mounting command Fedora used (i.e. -t nfs) was able to mount the directory while on Gentoo I got "Protocol not supported" (or something like that) and since I cannot really rule out that it is something in the configuration on my nfs-client, I do not really know what to say.

Comment 12 Dustin Polke 2011-03-01 12:40:21 UTC
(In reply to comment #11)
> For some reason the mounting command Fedora used (i.e. -t nfs) was able to
> mount the directory while on Gentoo I got "Protocol not supported" (or
> something like that) and since I cannot really rule out that it is something in
> the configuration on my nfs-client, I do not really know what to say.
Okay. Then we everything stays as is.
Thanks for reporting anyway.