Description of problem: After trying to mount an nfs share with the following options: -soft,intr,bg, =8192,wsize=8192,nfsvers=3 from a host that is temporarily down automount refuses any further automounting because it can not lock its lockfile. /var/log/messages Mar 7 11:01:05 ws1 automount[6035]: >> mount to NFS server 'ws2' failed: server is down. Mar 7 11:01:05 ws1 automount[6035]: >> mount: backgrounding "ws2:/scratch" Mar 7 11:01:46 ws1 automount[6046]: aquire_lock: can't lock lock file timed out: /var/lock/autofs Mar 7 11:01:46 ws1 automount[6046]: mount(nfs): nfs: mount failure ws3:/scratch on /scr/ws3 Mar 7 11:01:46 ws1 automount[6046]: failed to mount /scr/ws3 Mar 7 11:03:18 ws1 automount[6097]: aquire_lock: can't lock lock file timed out: /var/lock/autofs The last message is repeated serverl times. The first mount attempt induces the failure. The second mount failes even though the nfs export host is running. Version-Release number of selected component (if applicable): autofs-4.1.4-15.1 How reproducible: With the bg option to nfs mounts all the time. See the steps below. Steps to Reproduce: 1. Setup automounter map for NFS mount like so: /etc/auto.master /scr auto.scr /etc/auto.scr ws2 -soft,intr,bg,nfsvers=3,rsize=8192,wsize=8192 ws2:/scratch 2. NFS export ws2 is a simple export: /etc/exports /scratch @unix(rw,async) 3. Automount works without problems if NFS export host is up. 4. Shutdown NFS export host and retry the automount. 5. Mount failes with messages printed to /var/log/messages (see above). Actual results: Autmount failes due to the bg mount option and the fact that the lockfile does not get removed when the mount process is backgrounded. In some cases, when the mount failure was recognized soon enough, one could restart the automounter manually removing the lock file (/var/lock/autofs). It the system stays a long time with the automounter failing it will lock up eventually. Expected results: Just a message to /var/log/messages that the mount failed and the resume of normal operation. Additional info:
Specifying "bg" in the mount options for autofs is not supported. It will result in returning to the calling process (the one that triggered the mount) without having actually mounted the directory that was requested. This is broken. I'm closing this as NOTABUG. I'm also going to file another bug against autofs, requesting that the "bg" mount option be automatically ignored. In the mean time, please fix your maps.
(In reply to comment #0) > Description of problem: > > After trying to mount an nfs share with the following options: -soft,intr,bg, > =8192,wsize=8192,nfsvers=3 from a host that is temporarily down automount > refuses any further automounting because it can not lock its lockfile. As Jeff points out the bg option is not supported for autofs and in my opinion is not recommeneded for NFS mounts. You will no doubt respond pointing out that if a mount blocks waiting for a down server then no other mounts can be made. This is a different question and there is an autofs configure option to disable the locking for mount calls. The locking was originally introduced because of corruption in /etc/mtab caused by a bug in mount(8). Looking at mount(8) in FC4 I believe that it has a patch to resolve this. The configure option is however not the default as we have not yet been able to verify correct operation of autofs without it's locking. Backgrounding of mounts is a specific concern.