I'm trying to mount NFS filesystems over an OpenVPN link on Debian Squeeze. The problem is that the default layout of init scripts and such tries to mount the NFS filesystems before bringing up the VPN. With the default configuration, the system just hangs during boot.
My OpenVPN configuration is standard (a .conf
file in /etc/openvpn), and my fstab is
10.123.4.5:/path1 /localpath1 nfs rw,acl,relatime,soft,intr 0 0
10.123.4.5:/path2 /localpath2 nfs rw,acl,relatime,soft,intr 0 0
10.123.4.5:/path3 /localpath3 nfs rw,acl,relatime,soft,intr 0 0
I tried adding openvpn vpnname
to the stanza for my physical interface (eth1) in /etc/network/interfaces
, which makes it try to bring up the VPN when it brings up eth1, but it still tries to mount NFS first.
Shutting down is also an issue: with the default configuration, OpenVPN gets stopped before services which use the NFS mounts, so the halt/reboot hangs.
How can I get this to work? Clean "this is the 'right' way" solutions preferred; pragmatic solutions accepted. :)
Have you tried the 'bg' mount option? This should allow the mounts to continue booting in the background.
What about if you change the order of the init scripts, putting the services on the following order?
Since Debian boots on runlevel 2, you can enter on the /etc/rc2.d dir, and change the number right in front of the S (S91apache2 for example) putting higher nubers to mountnfs.sh, to ensure that will be executed after the openvpn and networking daemons.
Two options:
noauto
to the mount options; then add a custom initscript after OpenVPN that runsmount /localpath1
etc.