如何确保在login之前挂载nfs主目录

我有一台机器(安装了mythtv),它自动login一个用户,其主目录位于一个由NFS4访问的服务器上。 10次​​中的大约6次就像一个魅力,但有时login停止,因为主目录还不能访问。 主目录挂载由客户端和服务器(运行Ubuntu 10.04)上的autofs(使用LDAP)和NFS4进行pipe理。 任何想法,如何configuration“等到家里准备好”我的自动login?

在Ubuntu 10.04上,autofs和GDM都是Upstart( /etc/init )作业,这意味着它们可以并行运行。

然而,既然它们之间没有明确的依赖关系,那么在autofs之后就没有什么能够强制GDM启动了,所以两者之间就存在竞争条件。

解决这个问题的最好方法是重新configurationGDM,只有在autofs启动后才能启动。 为此,编辑/etc/init/gdm.conf ,并更改块的start on 。 它最初读到的地方,

 start on (filesystem and started dbus and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1 or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udevtrigger)) 

添加一个额外的条款,以便它读取

 start on (filesystem and started dbus and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1 or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udevtrigger) and started autofs)