Bug 645805

Summary: NFS mounts in fstab not automatically mounted by systemd
Product: [Fedora] Fedora Reporter: Eric Paris <eparis>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: bugzilla, lpoetter, metherid, mmaslano, mschmidt, mt-ml, notting, plautrba, schwab, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-12 12:22:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Paris 2010-10-22 14:08:22 UTC
systemd-11-1.fc15.x86_64

# cat /etc/fstab | grep storage
$SERVER:/export/   /storage   nfs tcp,noatime,nodiratime  0 0

# systemctl list-units -a | grep storage
storage.mount             loaded inactive dead          /storage

# systemctl start storage.mount
[works just fine after that machine is up]

Looking through syslog I see:
Oct 22 10:03:37 localhost sm-notify[1998]: DNS resolution of $SERVER failed; retrying later

Followed immediately by:
Oct 22 10:03:37 localhost dhclient[1931]: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Oct 22 10:03:37 localhost dhclient[1931]: DHCPACK from X.X.X.X

So I'm wondering if systemd isn't trying to mount my NFS partitions before the network is even up......

Comment 1 Eric Paris 2010-10-22 14:18:50 UTC
I changed the fstab line to read:

$SERVER:/export/   /storage   nfs tcp,noatime,nodiratime,_netdev  0 0

with no effect

Comment 2 Mirco Tischler 2010-10-22 14:51:11 UTC
It seems the netfs.service generated from /etc/init.d/netfs doesn't have a Wants=network.target and therefore starts the service before the network is available. The script itself checks for /etc/sysconfig/network but exits if it doesn't exist and never actually checks if [ $NETWORKING -eq yes ].

Comment 3 Bill Nottingham 2010-10-22 17:11:52 UTC
Eric, I'm assuming you're using init.d/network and not NM?

Comment 4 Eric Paris 2010-10-22 17:50:55 UTC
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
# Network Interface
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

NetworkManager-0.8.1-8.git20100831.fc15.x86_64

Comment 5 Bill Nottingham 2010-10-22 18:01:37 UTC
netfs should be triggered by the NM dispatcher script after it's connected.

Comment 7 Eric Paris 2010-10-22 18:25:07 UTC
I attached a copy of /var/log/messages involving network bring up and the message about the DNS name for my server being unresolvable.  Since it has private addresses and names in it I made it private, but if someone who can't see the comment needs this info I can sanitize a version and post it.

Comment 8 Lennart Poettering 2011-02-16 23:04:24 UTC
*** Bug 675680 has been marked as a duplicate of this bug. ***

Comment 9 Lennart Poettering 2011-02-18 12:11:38 UTC
*** Bug 678514 has been marked as a duplicate of this bug. ***

Comment 10 Lennart Poettering 2011-04-12 12:22:12 UTC
This should work fine on current F15 now. If you use NM you might need to run "systemctl enable NetworkManager-wait-online.service" however, so that the boot-up and the NFS mounts are delayed until the network is up. (We don't do this by default, since it usually as a bad idea to make the boot hang just because the external network is not ready)