Shutdown hangs with systemd and NFS mount

Bug #1438682 reported by Michael Boratko
88
This bug affects 20 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have the following line in /etc/fstab:
192.168.1.5:/srv/nsf4/main /shares nfs noauto,nofail,x-systemd.automount,_netdev,x-systemd.device-timeout=14,size=32768,wsize=32768 0 0

This works properly in the sense that systemd does not hold up the system when booting, and it does mount the directory upon first access, however the system hangs at shutdown in a manner consistent with systemd shutting down the network before attempting to unmount the drive. Indeed, even when the system is running, I can manually run

systemctl stop NetworkManager.service

and/or

systemctl stop network.target

and a call to

systemctl status shares.mount

shows that the mount is still active.

Finally, I will describe the debugging I have done to this point. First, if I manually unmount the share before shutting down, it shuts down immediately. Second, it should be noted that this does not in anyway depend on using the x-systemd.automount option. The same thing happens without automount (or fstab for that matter - simply manually mounting an NFS share and shutting down results in the computer getting stuck on the shutdown screen). I also tried adding additional items to the Require= and After= lines for shares.mount, specifically I tried adding network.target, NetworkManager.service, and wpa_supplicant.service. In each case, I did observe that manually running

systemctl stop NetworkManager.service

(for instance) now did cause the share to be unmounted, however if I shutdown the computer without manually stopping these services it would still stall on the shutdown screen. I can leave it for over 10 minutes, at which point I manually power it off.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: systemd 219-5ubuntu1
ProcVersionSignature: Ubuntu 3.19.0-10.10-generic 3.19.2
Uname: Linux 3.19.0-10-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.17-0ubuntu1
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Mar 31 09:05:25 2015
InstallationDate: Installed on 2015-03-31 (0 days ago)
InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Beta amd64 (20150326)
MachineType: Dell Inc. Dell Precision M3800
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/usr/bin/fish
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.19.0-10-generic root=/dev/mapper/AntergosVG-UbuntuRoot ro quiet splash vt.handoff=7
SourcePackage: systemd
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 11/14/2014
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A08
dmi.board.name: Dell Precision M3800
dmi.board.vendor: Dell Inc.
dmi.board.version: A08
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: Not Specified
dmi.modalias: dmi:bvnDellInc.:bvrA08:bd11/14/2014:svnDellInc.:pnDellPrecisionM3800:pvrA08:rvnDellInc.:rnDellPrecisionM3800:rvrA08:cvnDellInc.:ct8:cvrNotSpecified:
dmi.product.name: Dell Precision M3800
dmi.product.version: A08
dmi.sys.vendor: Dell Inc.

Revision history for this message
Michael Boratko (boratko) wrote :
Revision history for this message
Michael Boratko (boratko) wrote :

I should mention - I believe this is an upstream bug for systemd, as I have noticed similar (although not identical) behavior on Arch.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
hasan k (hasan-keler) wrote :

Happens to me as well with 16.04. If I forget to manually unmount all nfs shares before shutdown, it hangs forever. No fstab parameter seems to solve this problem. Any work-arounds?

Revision history for this message
Tommy Vestermark (tov) wrote :

Hi Hasan,

As you can see, this bug is duplicate. Please make your comment and "this bug affects me" indication on the other bug.

Revision history for this message
axelsvag (darinsson) wrote :

This affecting me too and the other bug closed the subject so this is still the only open , or am I wrong??

Revision history for this message
axelsvag (darinsson) wrote :

After yesterday upgrade with Ubuntu 16.04 where I can see systemd was among the packages the error seems to be solved. I tried 4 times yesterday and the shut down worked perfect only about 2 s from shut down command to black computer.

Revision history for this message
axelsvag (darinsson) wrote :

OK now all back to same problem as before shutdown hangs forever

Revision history for this message
Dan Bennett (pavementsands) wrote :

I have the same problem too, on 16.04

Revision history for this message
renm (renmsa) wrote :

I'm having this exact same issue on both 16.04 and 16.10, with two laptops.

My nfs shares are mounted via AutoFS service (/net -hosts) and that has been working fine for many years on previous releases.

When shutdown hangs, I can see message by hitting Esc says "Stop nfs ... nn m nn s/1m30s" some kind, then when the first number increases close to the 2nd ones. the 2nd one will increase too, then repeating like that forever.

Revision history for this message
Jonathan Schoreels (jonathan-schoreels) wrote :

The same on 17.04
Linux 4.10.0-21-generic #23-Ubuntu SMP Fri Apr 28 16:14:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.