Unmount NFS folders on wlan0 with pre-down

225 Views Asked by At

I'm working on this machine (Ubuntu 12.10) that needs to connect to a NAS via wlan.
/etc/fstab is configured with nfs auto and the directory is mounted correctly when the wlan is connected.
BUT
the computer won't shutdown and hangs waiting for the directory to be unmounted.
I did some research and the most common solution is mounting the directories with the soft,sync options but I'm not too sure about using soft.
I think this problem can be fixed with just unmounting the directory before bringing down the interface. So, I was thinking about using the pre-down function in /etc/network/interfaces, but I don't know how to write it correctly.

iface wlan0 inet manual
  pre-down /path/to/script_to_unmount_stuff.sh

Where script_to_unmount_stuff.sh would look like

umount -l /path/to/folder1
umount -l /path/to/folder2

Can something like this work?
Any other suggestion?
Thanks!

0

There are 0 best solutions below