Executable permissions on autofs map file cause ambiguity

Asked by barbablu on 2012-10-28

I would like to suggest a clarification in the Ubuntu wiki page Autofs, but as a newbie I seeking the opinion of others.

On my brand new Ubuntu 12.10 installation I was trying to automount some nfs shares from my media server and struggled until I noticed that automount interprets the content of a map file according to its executable setting: if set, key entries in the map file will be looked up as programs (not what I intended). I got it working with either/both of (i) ensuring permissions on the map file do not include executable flag or (ii) using the optional format specifier 'file:' when referring to it in auto.master. Just a few extra words about this in the wiki might be helpful.

The rest of this posting describes my configuration for those interested in reproducing the problem I had.

My troublesome auto.master contained:

/mnt/nas1 /etc/auto.nas1 --timeout=300 --ghost

Whilst the version that worked fine was:

/mnt/nas1 file:/etc/auto.nas1 --timeout=300 --ghost

The difference is in the presence of the optional 'file:' format specifier ahead of my map file 'auto.nas1'. I had (naively) set permissions on this file consistently with existing auto.smb and auto.net. The significant contents of my auto.nas1 map file are:

mymedia -fstype=nfs,hard,intr,timeo=10,async,rw,nodev,nosuid nas1:/media
mybackup -fstype=nfs,hard,intr,timeo=10,async,rw,nodev,nosuid nas1:/backup

I was using 'automount -v' to get more info in syslog and the troublesome section was reported as follows:

automount[7744]: attempting to mount entry /mnt/nas1/mymedia
automount[7744]: lookup(program): lookup for mymedia failed
automount[7744]: failed to mount /mnt/nas1/mymedia

(I later discovered the more immediate 'automount -v -f')

Question information

English Edit question
Ubuntu util-linux Edit question
No assignee Edit question
Last query:
Last reply:

You can add the mounts in /etc/fstab

you will need to add the command in /etc/rc.local above the 'exit 0' line:

mount -a

To make the network shares mount as fstab is processed before the network comes up.

Can you help with this problem?

Provide an answer of your own, or ask barbablu for more information if necessary.

To post a message you must log in.