Bug 857970

Summary: systemd mounts nfs shares on startup, but forgets to umount them before network shutdown
Product: [openSUSE] openSUSE 13.1 Reporter: Olaf Hering <ohering>
Component: NetworkAssignee: Neil Brown <nfbrown>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: systemd-maintainers
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: Outsourced Testing Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: 13.1-nfs-mount-shutdown-hang.txt

Description Olaf Hering 2014-01-08 18:58:28 UTC
Created attachment 573753 [details]
13.1-nfs-mount-shutdown-hang.txt

13.1 with xfce desktop.

I copied the fstab from another partition, it contains also a nfs entry:

IP:/share/dir /local/dir nfs soft,intr,tcp,bg,vers=3 0 0

For some reason this nfs entry gets mounted automatically, I did not do anything regarding nfs.
But during 'init 6' or 'init 0' the network is stopped before that nfs share is umounted. 
As a result the system hangs forever at the end of the shutdown, because IP does not respond. No surprise, the network is down already!

So whatevers does the automounting of such nfs share must also take care of autoumounting it before the network disappears.
Comment 1 Dr. Werner Fink 2014-02-14 10:30:27 UTC
Isn't that already fixed.
Comment 2 Neil Brown 2014-02-17 03:03:47 UTC
I think this problem should be handled by network-online.target forming a barrier between the remote mounts and the network interfaces.

i.e
 network interfaces are started Before network-online.target
and remote mounts are started After network-online.target

On shutdown these are interpreted in reverse, so
 network interfaces will be stopped After network-online.target
 remote mounts will be stopped Before network-online.target

On my test VM, the second of these conditions is met, the first is not.
So I experience the same hang that you do.

I edited

/usr/lib/systemd/system/network@.service

and added

Before=network-online.target


and the hang went away.  I think this is a correct fix.
If there is some other systemd unit which starts (and stops) network interfaces,
then it needs to ordered Before=network-online.target too.

Marius: do you look after sysconfig-network?  Can you take this?
Comment 3 Dr. Werner Fink 2014-02-17 07:56:07 UTC
The this is a dup of bnc #857031

*** This bug has been marked as a duplicate of bug 857031 ***