The officially official Devuan Forum!

You are not logged in.

#1 2024-04-17 04:59:32

greenant
Member
Registered: 2022-05-04
Posts: 13  

[SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

When I have NFS shares mounted, shutdown hangs (last message from rsyslog).

This is with Devuan Daedalus on Lenovo Thinkpad P14s (AMD edition).

I believe this is related to the order of events at shutdown (using sysvinit).

See ls /etc/rc6.d

K01alsa-utils	   K01lightdm			   K01vboxballoonctrl-service  K06umountnfs.sh
K01bluetooth	   K01openvpn			   K01vboxweb-service	       K07nfs-common
K01brightness	   K01pcscd			   K02avahi-daemon	       K07rpcbind
K01cups-browsed    K01pulseaudio-enable-autospawn  K02libvirtd		       K08hwclock.sh
K01docker	   K01saned			   K02network-manager	       K08networking
K01elogind	   K01speech-dispatcher		   K02vboxdrv		       K09umountfs
K01eudev	   K01tlp			   K03virtlogd		       K10umountroot
K01glances	   K01urandom			   K04sendsigs		       K11reboot
K01libvirt-guests  K01vboxautostart-service	   K05rsyslog		       README

I tried moving network manager to later in the shutdown sequence as I think the NFS umount is failing due to having network stopped first.

mv K02network-manager K07network-manager

That helps, now shutdown does complete, but there is a long delay if an NFS share is mounted.

I have tried changing the timeo property in the mount (from /etc/fstab):

nfserver:/data/media/video                        /mnt/media/video        nfs     defaults,soft,timeo=5,rw,_netdev        0       0

but the timeout doesn't seem to change the shutdown delay.

So 2 questions:

1. should the Devuan nfs-client package be updated to make sure nfsumount happens before network manager shutdown?
2. is there a way to control the NFS umount wait time so that the shutdown delay is not so long

p.s. just reporting back here too, Devuan runs very well on this laptop with a few little tweaks, thanks for all the great work maintainers!

Last edited by greenant (2024-04-26 12:05:32)

Offline

#2 2024-04-17 07:45:01

Andre4freedom
Member
Registered: 2017-11-15
Posts: 174  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

@greenant:
This happened to me all time, with every version of Devuan, but only when my laptop was/is connected by wifi (wlan).
I always use OpenRC and Cinnamon, and now I'm on Daedalus.
It happens when you mount your NFS resources over a wifi link. IT DOES NOT HAPPEN WHEN YOU ARE CONNECTED BY LAN (Ethernet).
So typically you will encounter the problem with laptops.

My solution is simple: On a laptop, I unmount all NFS resources before shutdown.
BTW: I'm very fond of Daedalus, or Devuan in general.

Offline

#3 2024-04-17 07:51:28

greenant
Member
Registered: 2022-05-04
Posts: 13  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

thanks @Andre4freedom, good to know I'm not the only one experiencing this issue.

I guess the reason you may be seeing this with WLAN only may be that your ethernet connection is set in /etc/network/interfaces.  Interfaces defined there will no longer be managed by Network Manager.

Unmounting NFS shares manually certainly works, but I have a bad habit of forgetting this, and I'm sure it will be possible to solve with the right sysvinit script tweaks...

Offline

#4 2024-04-17 10:49:58

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

I have NFS mounts on my laptop using wifi and network-manager, and I have no problems shutting down with the nfs mounts. Maybe it works for me because I use autofs to control the nfs mounts. The share gets mounted whenever I access it, and those mounts get cleaned up before networking shuts down. It's near the top of the list in /etc/rc6.d

K01autofs 

Offline

#5 2024-04-17 15:01:44

Andre4freedom
Member
Registered: 2017-11-15
Posts: 174  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

Fantastic! Thank you very much, fsmithred.
I will use it.....
Have a good evening (or a good day, depending where you live...)

Offline

#6 2024-04-19 04:42:35

greenant
Member
Registered: 2022-05-04
Posts: 13  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

@fsmithred that sounds like a likely fix.

Would you mind posting an example of one of your fstab mounts - just to make sure the autofs option is the only one needed!

Thanks

Offline

#7 2024-04-20 17:30:57

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

There is no fstab entry for this.

auotfs is installed on the client machine. nfs-kernel-server is iinstalled on the server machine and the exports are defined there.,

I added this line to /etc/auto.master

/mnt	/etc/auto.nfs

I created /etc/auto.nfs

filestore    remote-hostname:/home/user/data-to-share

Where filestore is just a name for the mountpoint that will be automatically created under /mnt when you access the share, and remote-hostname:/home/user/data-to-share corresponds to an actual nfs share on remote-hostname.

I usually make a symbolic link in my home dir that points to the mountpoint.

ln -s /mnt/filestore /home/user/my-shared-files

Restart autofs after making any changes.

Offline

#8 2024-04-26 12:04:26

greenant
Member
Registered: 2022-05-04
Posts: 13  

Re: [SOLVED] Shutdown fails due to NFS mounts failing to unmount (resolved: autofs)

thanks @fsmithred !

Using autofs worked well.

Offline

Board footer