Mounted NFS share prevents shutdown

Bug #1577120 reported by HasHPIT on 2016-05-01
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Undecided
Unassigned

Bug Description

On ubuntu 16.04 I mount an NFS share using "sudo mount ip.ip.ip.ip:/remote_path/remote_path localpath/"
When I try to shutdown or restart the computer it hangs.
It appears to be attempting to unmount the NFS share and theres a timeout, but each time it reaches the timeout, it gets increased.

I have read bug reports that similar issues were present in several previous ubuntu versions.
One work around was to soft mount instead of the default hard mount.

HasHPIT (hashpit) wrote :

I just noticed that if I don't do "a lot" on the mounted drive, it shuts down fine.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nfs-utils (Ubuntu):
status: New → Confirmed
Sean (seanshivak) wrote :

Same issue but only on wifi, issue doesnt occur on lan connections.

Sean (seanshivak) wrote :

This issue is fixed for me by editing nfs-config.service and adding After=local-fs.target remote-fs.target NetworkManager.service

sudo systemctl edit --full nfs-config.service

[Unit]
Description=Preprocess NFS configuration
After=local-fs.target remote-fs.target NetworkManager.service
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/scripts/nfs-utils_env.sh

Other suggestions on various forums dont work such as adding dbus.service to wpa_supplicant.service

Jeremie Tamburini (jeremie2) wrote :

@Sean
I have tried to use your workaround #4 but unfortunately didn't work on my computer.
Please could you let me know which options are you using on your /etc/fstab?

Thanks

Jeremie Tamburini (jeremie2) wrote :

OK, it seems that workaround #4 works if I wait a bit before shutdown/reboot. If I switch off the computer immediately after the boot, the problem will still be there.

Sean (seanshivak) wrote :

Hi sorry for the delay here is my NFS fstab entry.

192.168.0.100:/mnt /mnt/Server nfs4 _netdev,bg,nofail,rw,relatime,rsize=65536,wsize=65536 0 0

Jeremie Tamburini (jeremie2) wrote :

@Sean
I tried your fstab entry and it works perfectly, even if I switch off the computer immediately after the boot.

Thanks

Clive Wychwood (goshawk1973) wrote :

I have solved the same issue by doing a 'mount -a' command in the startup applications. This remounts the shares at the very end of the process, which seems to do what is necessary to straighten the dbus timing. A kludge option but very simple.

Harald Nikolisin (hochglanz) wrote :

Same Problem here with 16.04. and NFS automounter

Workaround #4 works here as well.

Jelle De Loecker (skerit) wrote :

The `nfs-config.service` fix did resolve my issue, but I noticed that without it the unmount job gets "terminated" by systemd when it reaches a certain timeout.

As the timeout is reached systemd still reached the "shutdown target", but fails to actually shut down the system.

So, yes, unmounting the nfs mount doesn't seem to work, but systemd should still shut down the system after the timeout is reached. I guess that's why some people are reporting bug #1594023 as fixed and some do not.

McFly81 (christian-lange-81) wrote :

Same issue here (KDE Neon 5.10, based on Ubuntu 16.04; last dist-upgrade today). When I'm trying to shutdown and press ESC on the Splashscreen I see the message "A stop job is running for <mountname>" with a timeout. When the timeout is reached, it is prolonged (at first ist was 1 minute 41, then 3 minutes 11, then 4 minutes 41, ...) but nothing more happens.

This occurs when mounting at startup via fstab and also when commenting out fstab entries for startup and doing manual "mount -a" after startup.

Sadly, Workaround from Post#4 didn't work for me.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers