Problem with shutdown with mounted NFS shares

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Problem with shutdown with mounted NFS shares

Postby paulm » Mon Jan 28, 2013 10:14 pm

I have two devices on my network that provide NFS shares. One is an Icy Box NAS4402-B (running a current version of OpenWrt), the other a home-brew sever running SMS. Both provide NFS4 mounts.

I've got multiple Linux distros installed on my laptop. I mainly use Arch, but have both SalineOS and Salix available as well.

When running Arch, I must unmount the NFS shares before shutting the laptop down. If I fail to do so (happens quite often, since I tend to forget that they're mounted), the laptop will not shut down, it simply hangs at the start of the shutdown. Sometimes I can break out of the hang using CTRL-C, but more often than not, I have to use the power switch.

I suspect that I've not got something correctly set up in systemd (which is now default init for Arch), but I'm having trouble confirming it. What makes me suspicious is if I manually unmount the shares before attempting to shutdown there is no problem. I tried adding the unmount commands to /etc/rc.local.shutdown, but that hasn't helped. It looks as if the hang occurs before rc.local.shutdown is executed, since I get errors from the commands if the shares are not mounted when I shut down, but don't see any sign of the system getting that far if the shares are mounted.

I've tried changing the export commands on both NFS severs, but haven't seen any change. I could try 'soft' mount, but I'm wary of the potential data corruption.

Does anyone have any idea how I could go about tracking down what is holding the shares open and preventing the shutdown, or does anyone know enough about systemd to know what should be used setting it up for NFS?

I've tried asking questions in the Arch forum and mailing lists, but so far have only got a couple of people reporting similar problems, no suggested solutions..... I should also note that the problem only occurs under Arch - both SalineOS and Salix will shutdown cleanly without manually unmounting the NFS shares prior to shutting the system down.

Paul.


Paul.
paulm
LXF regular
 
Posts: 242
Joined: Mon Apr 03, 2006 4:53 am
Location: Oxfordshire, UK

Postby nelz » Mon Jan 28, 2013 11:36 pm

This can happen if the network connection is dropped before the shares are unmounted. Unmounting a dead NFS share can hang forever. What is handling your network? If it is NetworkManager, you may be dropping the connection when you exit the desktop.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8468
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby paulm » Tue Jan 29, 2013 11:04 pm

nelz wrote:This can happen if the network connection is dropped before the shares are unmounted. Unmounting a dead NFS share can hang forever. What is handling your network? If it is NetworkManager, you may be dropping the connection when you exit the desktop.


Thanks for the suggestion, Nelz. Could well be the cause - I am currently using NetworkManager. I'm not all that fond of it and had been thinking of removing it and replacing it with Wcid. From memory, I think that Wcid leaves the connection active when the desktop is closed. Otherwise I can try manually and see if that makes a difference.

Paul.
paulm
LXF regular
 
Posts: 242
Joined: Mon Apr 03, 2006 4:53 am
Location: Oxfordshire, UK

Postby nelz » Tue Jan 29, 2013 11:49 pm

It's wicd, and it does leave the connection up until the daemon shuts down.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8468
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby paulm » Thu Jan 31, 2013 11:21 pm

nelz wrote:It's wicd, and it does leave the connection up until the daemon shuts down.


:oops: When I previewed my message I noticed I'd got a bit dyslectic spelling one instance of wicd. So I corrected the wrong one.....

Looks promising though. I've not had time to test it properly yet, but a couple of quick tries with wicd instead of NetworkManager have resulted in a clean shutdown.

:) Must admit, I prefer wicd anyway. A few months ago I had all sorts of problems losing connection to my T-Mobile pointer, all solved by dumping NetworkManager and putting wicd in its place (on SalineOS in that instance).

Paul.
paulm
LXF regular
 
Posts: 242
Joined: Mon Apr 03, 2006 4:53 am
Location: Oxfordshire, UK


Return to Help!

Who is online

Users browsing this forum: Bing [Bot] and 3 guests