Bug 999061

Summary: NFS mounts get added to local-fs.target which causes a dependency cycle and a hang on shutdown
Product: [Fedora] Fedora Reporter: Ian Collier <imc>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: harald, imc, johannbg, lnykryn, msekleta, plautrba, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-204-16.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 11:38:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Collier 2013-08-20 16:11:09 UTC
On a booted Fedora 19 system, if you happen to mount an NFS filesystem then the system creates a mount unit configuration for it in systemd.  So:

$ mkdir /mnt/F19
$ mount csfs:/cs/software/fedora/fedora19 /mnt/F19
$ systemctl status mnt-F19.mount

For some reason, this unit is now scheduled before local-fs.target:

$ systemctl show mnt-F19.mount | grep Before
Before=local-fs.target umount.target

But now there is a dependency cycle, because:

local-fs.target is after mnt-F19.mount
mnt-F19.mount is after network.target
network.target is after network.service
network.service is after basic.target
basic.target is after sysinit.target
sysinit.target is after local-fs.target

(this is on a machine with NetworkManager not installed and the SysV network service turned on, but that may not in fact matter).

As a result, when this machine is shut down, the network mount is never unmounted and the shutdown hangs forever.  If I manually unmount all network filesystems before shutting down then the system shuts down cleanly.

The correct thing to do would seem to be to make mnt-F19.mount come before remote-fs.target and not involve local-fs.target at all.

systemd version: systemd-204-9.fc19.x86_64

Possibly related: Bug 988587, Bug 908123

Comment 1 Harald Hoyer 2013-08-21 09:30:05 UTC
a network mount is defined either by the "_netdev" option in /etc/fstab or by the following filesystems:

cifs
smbfs
ncpfs
ncp
nfs
nfs4
gfs
gfs2

Comment 2 Lennart Poettering 2013-09-12 19:28:05 UTC
Can you please provide the exact line /proc/self/mountinfo contains for that mount in question?

Comment 3 Ian Collier 2013-09-13 09:32:12 UTC
# egrep F19 /proc/self/mountinfo

139 34 0:40 / /mnt/F19 rw,relatime shared:122 - nfs csfs:/cs/software/fedora/fedora19 rw,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=129.67.151.106,mountvers=3,mountport=597,mountproto=udp,local_lock=none,addr=129.67.151.106

Comment 4 Fedora Update System 2013-10-06 22:16:22 UTC
systemd-204-16.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/systemd-204-16.fc19

Comment 5 Fedora Update System 2013-10-08 11:38:48 UTC
systemd-204-16.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.