Bug 139934 - netfs fails to mount nfs file systems from /etc/fstab
Summary: netfs fails to mount nfs file systems from /etc/fstab
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2004-11-18 20:49 UTC by Aleksandar Milivojevic
Modified: 2014-03-17 02:50 UTC (History)
2 users (show)

Fixed In Version: 8.35-1
Clone Of:
Environment:
Last Closed: 2006-07-11 16:32:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
sleep 5 than nfs mount (444 bytes, patch)
2004-11-19 14:22 UTC, Aleksandar Milivojevic
no flags Details | Diff
add check_link_down to ifup script (328 bytes, patch)
2004-11-19 21:10 UTC, Aleksandar Milivojevic
no flags Details | Diff
fix for check_link_down (1.18 KB, patch)
2004-11-19 21:41 UTC, Bill Nottingham
no flags Details | Diff

Description Aleksandar Milivojevic 2004-11-18 20:49:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020
Firefox/0.10.1

Description of problem:
I have two NFS file systems defined in /etc/fstab, on a box that is
NIS client (important).

They look something like this:

1.2.3.4:/foo   /foo   nfs   rsize=8192,wsize=8192   0 0
1.2.3.4:/bar   /bar   nfs   rsize=8192,wsize=8192   0 0

During boot, /foo fails to mount with an error stating that NFS server
is down.  /bar mounts fine.  When machine is up and running, I can
mount /foo manually by doing "mount /foo".

If I change order in /etc/fstab (/bar first, /foo second), than /bar
is the one that fails to mount.  So it is always the first NFS mount
point from /etc/fstab.  Second, third, and so on always mount fine.

It took me long time to figure out (with help from Fedora mailing
list) what is going wrong.

The box in question is NIS client.  ypbind script is called *after*
netfs script.  If I change the order of scripts in /etc/rc?.d
directories (first ypbind, then netfs) everything works fine.

I used IP addresses in /etc/fstab, so theoretically even if no name
services is available, everything should work.  However, in this
specific setup it doesn't.  I don't know why.  Is there reverse lookup
happening during NFS mount?

Some possible solutions could be:

1) reorder scripts in /etc/rc?.d so that netfs is called only after
all name related services are up and running (ypbind for sure, I guess
ldap and named too?).  Of course, in this case those name services
shouldn't have any data stored on NFS mount points defined in /etc/fstab.

2) Change timeout values so that mounts do not fail because name
service is unavailable (when calling mount command?  somewhere else?).

3) Remove/disable reverse lookup on IP addresses in /etc/fstab (if it
is happening).

Version-Release number of selected component (if applicable):
initscripts-7.93.2-1

How reproducible:
Always

Steps to Reproduce:
1. define two or more NFS mount points in /etc/fstab on NIS client


Actual Results:  First mount point from /etc/fstab fails to mount with
"server is down" error message.

Expected Results:  All mount points should mount correctly.  The
server is up, and IP addresses were used in /etc/fstab.

Additional info:

Comment 1 Bill Nottingham 2004-11-18 20:57:36 UTC
Static IP?

Comment 2 Aleksandar Milivojevic 2004-11-18 21:39:27 UTC
Both client and the server have static IP address.

Comment 3 Bill Nottingham 2004-11-18 22:39:46 UTC
I'm guessing that if you add 'sleep 5' to the top of netfs, it works?

Comment 4 Aleksandar Milivojevic 2004-11-19 14:22:21 UTC
Created attachment 107051 [details]
sleep 5 than nfs mount

Ah, so my great theory falls apart.  Sleep 5 does the trick.  Is it needed for
NFS only or for all the stuff in netfs?  What I did for now was to add sleep 5
just before NFS mounts, not to slow boot process if there's no NFS mounts.  As
in attached patch.

BTW, is this something specific for my installation (what? why?), or is this
generic problem?

Thanks for help.

Comment 5 Bill Nottingham 2004-11-19 20:15:46 UTC
It appears that when it tries to mount the first NFS share, it's still
negotiating with the switch for link.

Comment 6 Bill Nottingham 2004-11-19 20:18:20 UTC
You could concievably fix this by adding:

check_link_down ${REALDEVICE}

to the end of the static networking init section in ifup.

Comment 7 Aleksandar Milivojevic 2004-11-19 21:10:09 UTC
Created attachment 107090 [details]
add check_link_down to ifup script

I've attempted to add check_link_down to ifup script as you suggested, and it
didn't work.  I've added one debugging echo to it, and by looking in log files
after reboot, it seems that check_link_down was called only for lo interface,
but not for eth0 interface.  eth0 has static IP address, so I would expect that
I added it to the right place (after line 407 in FC3 ifup script).  I've
inluded the patch with changes that I made.

Comment 8 Bill Nottingham 2004-11-19 21:41:32 UTC
Created attachment 107091 [details]
fix for check_link_down

You probably need this as well.

Comment 9 Aleksandar Milivojevic 2004-11-22 14:27:40 UTC
I've tried it out, still same results (error while mounting first file
system).  In log files I'm seeing "waiting for link on lo" (from my
patch), but not on eth0.

BTW, looking at your patch, it looks mostly as different formatting? 
I can't find any differences in the code?

Comment 10 Bill Nottingham 2004-11-22 16:08:25 UTC
In the previous version, if the link is 'UP' according to ifconfig, it
skips the test entirely.

Comment 11 Aleksandar Milivojevic 2004-11-22 20:48:58 UTC
Hm, even after calling check_link_down and patching network-functions,
it still doesn't work.  I've added some debugging, so I know that
check_link_down was called for my ethernet interface.  check_link_down
returns indicating that link is up.  However netfs still fails to
mount first file system.

This is how I called check_link_down:

    # Wait for link
    if check_link_down ${REALDEVICE}; then
        echo $" failed; no link present.  Check cable?"
    fi

(maybe this should be part of ifup anyhow, it would only print warning
during boot if cable is unplugged).

Comment 12 Matthew Miller 2006-07-10 22:24:51 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 13 Bill Nottingham 2006-07-11 16:32:28 UTC
There is NETWORKDELAY and LINKDELAY in the current development initscripts that
may help to solve this for you.

From sysconfig.txt:

  NETWORKDELAY=<delay in seconds>
    Delay in seconds after all network interfaces are initialized.  Useful if
    network has spanning tree running and must wait for STP convergence.
    Default: 0 (no delay)

    LINKDELAY=<time in seconds>
      Time that the system should pause after the specific interface is
      enabled.  This may be useful if one interface is connected to a
      switch which has spanning tree enabled and must wait for STP to
      converge before the interface should be considered usable.



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