Pi not able to reboot because of nfs unmount failure

Often when I reboot my volumio installed pi, it will get hung up during shutdown. I see messages in the console like this:


[ok] Stopping Network connection manager: wcid.

[[timestamp]] nfs: server freenas not responding, still trying

And then it hangs, waiting for my NFS server to respond. it looks like this response will never happen because wicd has already shutdown network connections. I eventually just have to unplug the device and start it that way.

When it boots it also fails to remount NFS. I have to go into the Volumio UI and manually remount (open the mount for editing and then hit save). I assume this is related, but unsure.

is there a way to work around this issue? Can I change the order of service shutdown?

as a side note, where are the NFS mount details saved?

So I’ve been able to work around this. Here’s how.
Create two scripts, i’m putting them in /home/volumio/bin/.
First script (this will resolve the shoutdown issue):

volumio@volumio:~$ cat bin/pre-halt 
#!/bin/bash
echo "Unmounting NAS Before network shutdown..." | sudo tee -a /var/log/pre-halt.log
sudo umount /mnt/NAS | sudo tee -a /var/log/pre-halt.log

Second script (this solves the other issue of my NAS not remounting on boot-up):

volumio@volumio:~$ cat bin/post-boot 
#!/bin/bash
sudo mount.nfs freenas:mnt/music_store /mnt/NAS
sudo service mpd restart

Finally, I set the first script to run before the wicd network disconnects:

sudo ln -s /home/volumio/bin/pre-halt /etc/wicd/scripts/predisconnect/pre-halt

And set the second script to run after the network has reconnected.

sudo ln -s /home/volumio/bin/post-boot /etc/wicd/scripts/postconnect/post-boot

This probably isn’t an issue if you aren’t using a USB wifi adapter, as you would be using plain old ethernet which is run by the network service, not wicd, and volumio is already set to recover properly on ethernet.