Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 20042 - init_node() in functions.sh for adelie clustering attempts to connect to non-existant NFS server (provided by baselayout ebuild)
Summary: init_node() in functions.sh for adelie clustering attempts to connect to non-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-27 09:01 UTC by Tim Hobbs
Modified: 2004-01-19 09:58 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Hobbs 2003-04-27 09:01:55 UTC
Additions have been made to /sbin/rc and /sbin/functions.sh to accomodate the 
adelie linux clustering methodology.  This is great!
However, some things don't work.  Most troublesome is the following:
  if grep -q -v "^${DIR}[[:space:]]" /etc/exports
  then
    mount -o nolock -n server:"${DIR}" "${DIR}"
  fi

This is not in the scripts available from adelie, but only in the gentoo 
version.  I think I understand what is trying to be accomplished (mount 
the /etc,/var, and /root directories from the NFS server) but do not understand 
why the following grep expression is used:
grep -q -v "^${DIR}[[:space:]]" /etc/exports

Which states: If ANY line is found in /etc/exports OTHER THAN (lines starting 
with) /etc(/var,/root), then mount...

This will nearly ALWAYS return 0 (true), for several reasons:
1. The first line in the /etc/exports file is typically a comment (and there 
may be other comments)
2. If there are ANY exports OTHER THAN /etc (/var,/root), then an attempt will 
be made to mount /etc (/var,/root), which could definitely fail if /etc 
(/var,/root) are NOT actually exported.

Even if the grep was changed to only try to mount IF the desired directory was 
exported, it would not account for the export of the entire server root (which 
adelie does do).

Following the adelie methodology, the server's root is exported, and is ALREADY 
mounted by the kernel by the time the node is being initialised.  In this case, 
there is no reason to try and mount the directories again, since they are 
already mounted.

Of course, if the grep issue were resolved, there is still the issue of trying 
to mount directories from the machine named "server".  It is highly unlikely 
that the NFS server actually has the name "server" (although an /etc/hosts 
entry on the server would "resolve" this (yuck)).

I recommend that this entire if then block be removed, unless there is a good 
reason for it that I just do not understand (it is not annotated in CVS why 
this change was made).


Reproducible: Always
Steps to Reproduce:
1. Setup gentoo server and node via adelie method, sending "gentoo=adelie" 
kernel option when booting node

Actual Results:  
boot fails

Expected Results:  
boot succeeds

Workaround: comment out the if then block in /sbin/functions.sh as follows:
...
        for DIR in /etc /var /root
        do

                #if grep -q -v "^${DIR}[[:space:]]" /etc/exports
                #then
                #       mount -o nolock -n server:"${DIR}" "${DIR}"
                #fi
...
Comment 1 Tim Hobbs 2003-04-27 09:32:35 UTC
The unmount line should also be removed or commented at the end of the for loop:
#umount -n "${DIR}" > /dev/null
Comment 2 Olivier Crete (RETIRED) gentoo-dev 2003-06-26 15:09:48 UTC
I wrote this part of the code. This was added so it would work when /etc /var /root are in a different partition on the server. NFS doesnt cross partition mount-points, so we have to export each partition and mount them separately. Which brings us to this piece of code which mounts them(before we have access to the fstab). Btw, this whole piece of code is being moved to a regular init script, you may want to see the details in bug 4151. I agree with you that the -v is bizzare and I dont understand why it ever worked ;)
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-06-27 14:30:23 UTC
Olivier, can you guys get a patch going and tested, then I can apply ?
Comment 4 Olivier Crete (RETIRED) gentoo-dev 2003-06-27 14:36:22 UTC
There are patches in bug 4151 for our new version where this part of the script is moved out of the "generic" initscript and into a custom script using those.
Comment 5 Martin Holzer (RETIRED) gentoo-dev 2004-01-15 08:19:03 UTC
can this bug be closes ?
Comment 6 Olivier Crete (RETIRED) gentoo-dev 2004-01-18 17:12:48 UTC
This refers to an older version of the adelie system.. With the new more flexible base-layout, we can do the initialisation in regular scripts in the "boot" runlevel! (so this problem is no longer there)
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2004-01-19 09:43:45 UTC
Are you guys still up to writing a guide for Adelie/nfs setup?
Comment 8 Olivier Crete (RETIRED) gentoo-dev 2004-01-19 09:58:20 UTC
We have an installation guide kind of thing, but there are a few things we'd like to adjust before we make a a release...