Mounted NFS share blocks reboot for 90 sec

Hy!

Have on a TW KDE an NFS share mounted via fstab:

172.16.25.83:/media/NAS7                   /media/NAS7/ nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0  

When rebooting the TW I get a 90 sec “time-out wait” for the NFS, apparently the share is not unmounted and so reboot stops.

What is the solution to unmount the NFS share automagically on reboot without waiting 90 secs?

Of course the system will try to unmount it at shutdown. Is the NFS server up at that moment?

BTW, you specifically mentioning “reboot”. does that mean that all goes well on a shutdown.

NFS server is always on, 24/7 :slight_smile:

No, I never do shutdown, as the TW is normally on 24/7, but needs reboots after kernel updates etc.

I did not ask for your habits. I asked if you did this test, which seems very logical to me to try out first.

And why didn’t you answer my first question?

Things will take much more time when you do not read and act step by step on what people ask you when they try to help.

shutdown -h now

gives same 90 sec time-out as reboot. As expected.

To make sure they are unmounted before network is shut down. This question pops up on these forums quite often for years.

How to do that automagically with “reboot”? Systemd? I followed some doc to automount the NFS share on boot, but that didn’t mention manual unmount before reboot. how to set the time-out to, let’s say, 10 sec instead of 90 sec?

When you use “automount”, it will be unmounted mostly long before you shutdown. Except of course when you mount e.g. /home or the home directory of the user that is logged in, or a directory that a user used just until the very end of his session.

I have:

boven.henm.xs4all.nl:/home/wij   /home/wij  nfs   noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10,x-systemd.idle-timeout=5min  0  0

Without any problems whatsoever for already some years.

Thus it will be unmounted 5 mins after last usage. I must add that in this case wij is not a user that logs in, but the data there is used by other users.

Maybe yes, but you specifically mentioned “reboot”. And we read every word of a problem description because it may provide important information.

I would like to keep my NFS mount always mounted, until I reboot/shutdown. So is there an option to reduce the 90 sec time-out to 10 sec somewhere in TW? :slight_smile:

There is an option to reduce timeout for both mount and unmount. Read man systemd.mount.

…but there is no /etc/systemd/systemd.conf to set

DefaultTimeoutStopSec

Many moons ago I put this in root’s .bashrc:

alias OFf='cd; swapoff -a; umount -a; systemctl poweroff '
alias Off='cd; swapoff -a; umount -a; systemctl poweroff '
alias REboot='cd; history -w; swapoff -a; umount -a; systemctl reboot '
alias Reboot='cd; history -w; swapoff -a; umount -a; systemctl reboot '
#

I don’t recall having had any NFS-related delay in shutdown or reboot from bash since.

How about /etc/systemd/system.conf
This file is present in all systemd installations…

I later learned to use a systemd drop-in to do it instead. Create /etc/systemd/system.conf.d/local.conf.

nano /etc/systemd/system.conf.d/local.conf

and added

DefaultTimeoutStopSec=5s

and

systemctl daemon-reload

but reboot still gives 90sec time-out… :frowning:

Did you read the instructions for creating drop-ins? One line won’t do it. You must include instruction where in the parent file it must situate, here: [Manager]

adding to the same file

DefaultTimeoutAbortSec=5s

gives me now a 4:30 min time-out, which prolongs itself to 6 min waiting for

“RealtimeKit Scheduling Policy Service”

Pain!

…added, reloaded, same 90sec time-out on reboot. Strange.

What exactly does the file contain now?