6

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

1
  • Did the 'bg' mount solution worked?
    – user130370
    Aug 16, 2012 at 15:10

3 Answers 3

1

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

0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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