Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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. :)

share|improve this question
    
Did the 'bg' mount solution worked? –  coincoin Aug 16 '12 at 15:10

3 Answers 3

Two options:

  • Use autofs for these mounts; they'll only be mounted when actually accessed (which presumably will only be after the VPN comes up).
  • Add noauto to the mount options; then add a custom initscript after OpenVPN that runs mount /localpath1 etc.
share|improve this answer

What about if you change the order of the init scripts, putting the services on the following order?

  • networking
  • openvpn
  • nfs-related services

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.

share|improve this answer

Have you tried the 'bg' mount option? This should allow the mounts to continue booting in the background.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.