automount doesn't work with NFS root

Bug #226219 reported by James E. Blair
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autofs (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: autofs

Description: Ubuntu 8.04
Release: 8.04

autofs:
  Installed: 4.1.4+debian-2.1ubuntu1

I use autofs on a diskless machine which mounts / over NFS. In Ubuntu's autofs, the patch:

  debian/patches/077_dont_create_remote_dirs.dpatch

is applied, which causes automount to refuse to create the mount-point if it is not on a local filesystem (it decides this based on parsing /etc/mtab). Unfortunately, this change is not reflected in the documentation, which still reads:

       mount-point
              Base location for autofs-mounted filesystems to be attached. This is a
              directory name that will be created (as with mkdir -p) and later when
              automount terminates will be removed (as with rmdir -p).

So, it is a surprise that when I run autofs with an NFS root, if the mount-point does not exist when automount starts, it just logs:

  automount[8821]: failed to create iautofs directory /nfs

and exits. So, at the very least, the documentation should be updated, and it should give an appropriate error message indicating why it refuses to create the mount-point.

But this problem is exacerbated by the fact that the patch as written will still happily cause a remote mount-point to be removed on exit, regardless of whether it created it or not. So if the mount-point is on NFS, and exists, then automount will start, and upon exit, remove the mount-point, and will therefore fail to start a second time.

In trying to devise a solution to this problem, I was stumped by the lack of documentation, comments, or even a general description associated with the 077_dont_create_remote_dirs.patch. There are several ways to fix the problem that I'm having, but without knowing why the patch was included in the first place, I don't know what problem it was originally supposed to fix, and can't tell whether my solutions would cause a regression for whatever that problem was. I can say that whatever it was, it doesn't seem to affect my situation -- without the patch, automount works quite well on an NFS root system.

Perhaps the best solution is to add a new option to automount that would govern the behavior of creating the mount-point.

Revision history for this message
Matteo Croce (teknoraver) wrote :

This change to /etc/init.d/autofs fixes it

Changed in autofs:
status: New → Confirmed
Revision history for this message
click170 (click170) wrote :

I also have a diskless client running Ubuntu 9.04 which mounts home directories from autofs.

The workaround suggested by Matteo Croce works in the meantime until a permanent solution is found.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.