Bug 645805 - NFS mounts in fstab not automatically mounted by systemd
Summary: NFS mounts in fstab not automatically mounted by systemd
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 675680 678514 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-22 14:08 UTC by Eric Paris
Modified: 2011-06-01 19:59 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-04-12 12:22:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 703852 0 medium CLOSED NFS mounts not getting mounted automatically during start-up 2021-02-22 00:41:40 UTC

Internal Links: 703852

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)


Note You need to log in before you can comment on or make changes to this bug.