You are not logged in.

#1 2010-08-11 00:34:49

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

[SOLVED] Netfs shutdown routine takes ages

I have been running Arch on my AppleTV for a while now, but after adopting netfs to automate NFS mounts at boot I am experiencing long hangs during the shutdown process. It will hang on the netfs service for about a minute (or even more) and then proceed to shut down cleanly. Since the network is brought down only at the end, it shouldn't be a network timeout problem.

This is my DAEMONS array:

DAEMONS=(syslog-ng @acpid network @dbus @crond @dropbear @alsa @cpufreq @ntpd nfs-common netfs)

As you can see the netfs service is the very last to be started, so it's also the very first to be shut down.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#2 2010-08-11 01:19:49

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: [SOLVED] Netfs shutdown routine takes ages

I think you should have rpcbind in there too, before nfs-common.

Offline

#3 2010-08-11 12:12:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Netfs shutdown routine takes ages

According to the Arch wiki entry for NFS rpcbind is started by the nfs-common script smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#4 2010-08-11 20:36:49

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Netfs shutdown routine takes ages

.:B:. wrote:

I have been running Arch on my AppleTV for a while now, but after adopting netfs to automate NFS mounts at boot I am experiencing long hangs during the shutdown process. It will hang on the netfs service for about a minute (or even more) and then proceed to shut down cleanly. Since the network is brought down only at the end, it shouldn't be a network timeout problem.

This is my DAEMONS array:

DAEMONS=(syslog-ng @acpid network @dbus @crond @dropbear @alsa @cpufreq @ntpd nfs-common netfs)

As you can see the netfs service is the very last to be started, so it's also the very first to be shut down.

Do you have any mounted network drives? IIRC (and I've been meaning to do some tests but the situation doesn't occur very often, so I may be wrong - which is why I haven't reported it before), but I think my network is brought down before network mounts, so they then take ages to try and unmount on shutdown.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2010-08-11 22:29:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Netfs shutdown routine takes ages

I do have that NFS mount yes. That unmounts manually within a few seconds (it's a 2 TB drive, NFS seems to notice that). The thing is the services are in the correct order; if the network somehow is shut down before the networked filesystems are that's a big design problem smile. You can see the 'network' service right at the start of my array as well.

The netfs shutdown routine hangs 100% of the time over here.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2010-08-12 00:29:02

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: [SOLVED] Netfs shutdown routine takes ages

Are you using user,noauto in your mount options in fstab? Two of my shares are configured with those options. I have to unmount them manually before shutting down as netfs fails on them (why?) but unmounts the other nfs shares. Starting and stopping netfs from cli would fail whenever those two shares where mounted but using

umount.nfs <mountpoint>  -vlf

to unmount them worked. I now use /etc/rc.local.shutdown to unmount those two shares if mounted.
Not ideal but it worked.
Also, the nfs share is still up when you shut down on the AppleTV? Shutdown will hang at unmounting nfs stage if the server is down.

Offline

#7 2010-08-12 12:07:24

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Netfs shutdown routine takes ages

The server is up 24/7. It would be a bit silly to complain about the shutdown routine hanging when the server would cause timeouts by being shut down already tongue.

This is my NFS entry:

amalthea:/var/data/video    /home/stijn/server/    nfs    ro,defaults,intr,auto,noatime,rsize=32768,wsize=32768,async,nfsvers=3    0    0

I do notice rpcbind is stopped *before* netfs. That does sound like asking for trouble to me...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2010-08-12 14:18:35

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Netfs shutdown routine takes ages

.:B:. wrote:

I do notice rpcbind is stopped *before* netfs. That does sound like asking for trouble to me...

rpcbind is started by nfs-common but not stopped by it. The shutdown routines call for all daemons not in the DAEMONS array to be stopped prior to those listed to be shut down. So, adding rpcbind to the daemons array should alleviate this issue.

Offline

#9 2010-08-12 14:21:32

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Netfs shutdown routine takes ages

I'll see how that works out, thanks smile.

Edi: that did the trick quite nicely, thanks falconindy smile.

Last edited by .:B:. (2010-08-12 18:30:49)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB