Bug 447307 - ypbind init does not always respect NISTIMEOUT
ypbind init does not always respect NISTIMEOUT
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: ypbind (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: Vitezslav Crhonek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-19 09:31 EDT by Ian Collier
Modified: 2008-06-11 00:33 EDT (History)
0 users

See Also:
Fixed In Version: 1.20.4-5.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-11 00:33:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Suggested fix for ypbind init script issues (1.05 KB, patch)
2008-05-19 09:58 EDT, Ian Collier
no flags Details | Diff

  None (edit)
Description Ian Collier 2008-05-19 09:31:07 EDT
Description of problem:

Our lab is full of irritating ethernet switches that take half a minute to wake
up once the computer's interface is brought up.  The observable effect of this
is that it takes about half a minute for NIS servers to respond when the
computer is booted up.

For Fedora 9 we need NISTIMEOUT set to something over 60 (because the init
script assumes "ypwhich" takes 15 seconds whereas it appears to be somewhat
faster than that - related bug 430409).  However, it still doesn't always work
because there is a race condition in the ypbind init script which means that
NISTIMEOUT is not always used.

The instruction "timeout=$NISTIMEOUT" in the init script is dependent upon the
condition failure==1.  This in turn is set when "rpcinfo -p" indicates that
ypbind hasn't started up yet.  However, if the daemon is fast enough to start up
before the loop executes for the first time then this will never happen, and the
timeout value actually used is hardcoded to 10, which means our NIS servers
never get the chance to respond before the script times out and shuts down the
ypbind service.

This was also a problem on Fedora 8, but we more-or-less skipped that release
and so didn't notice.  Fedora 7 always uses the given NISTIMEOUT value and thus
works fine.

Version-Release number of selected component (if applicable):
ypbind-1.20.4-4.fc9.x86_64
Comment 1 Ian Collier 2008-05-19 09:58:21 EDT
Created attachment 305944 [details]
Suggested fix for ypbind init script issues

This could be fixed by renaming "failure" to something more descriptive (e.g.,
"firsttime"), setting it to 1 before the loop instead of 0, and not setting it
in the "wait for ypbind to get started" section.

In addition, something real-time based (as suggested in bug 430489) should be
used instead of the current hack.  Since the script currently runs in /bin/bash
this is as simple as setting SECONDS=0 before the loop and then looping on [
$SECONDS -lt $timeout ].

The attached (lightly tested) patch implements the above suggestions and also
fixes a few incorrectly (IMHO) indented lines.
Comment 2 Vitezslav Crhonek 2008-05-20 08:46:27 EDT
Thanks for report and patch. Patch seems fine to me, I have no remarks to it.
Comment 3 Fedora Update System 2008-05-23 08:30:58 EDT
ypbind-1.20.4-5.fc9 has been submitted as an update for Fedora 9
Comment 4 Fedora Update System 2008-05-28 22:51:32 EDT
ypbind-1.20.4-5.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ypbind'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-4631
Comment 5 Fedora Update System 2008-06-11 00:33:49 EDT
ypbind-1.20.4-5.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

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