Bug 447307

Summary: ypbind init does not always respect NISTIMEOUT
Product: [Fedora] Fedora Reporter: Ian Collier <imc>
Component: ypbindAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.20.4-5.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-11 04:33:51 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:
Attachments:
Description Flags
Suggested fix for ypbind init script issues none

Description Ian Collier 2008-05-19 13:31:07 UTC
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 13:58:21 UTC
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 12:46:27 UTC
Thanks for report and patch. Patch seems fine to me, I have no remarks to it.

Comment 3 Fedora Update System 2008-05-23 12:30:58 UTC
ypbind-1.20.4-5.fc9 has been submitted as an update for Fedora 9

Comment 4 Fedora Update System 2008-05-29 02:51:32 UTC
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 04:33:49 UTC
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.