Red Hat Bugzilla – Bug 322101
service ypbind start fails: checking rpcbind too soon after start
Last modified: 2008-01-11 17:37:05 EST
Description of problem:
The ypbind service is not starting, due to the fact that the ypbind init.d
script is checking for ypbind being registered with rpcbind too quickly after
Here's the offending section of the script: numbers at the start of the line
refer to the analysis below:
echo -n $"Starting NIS service: "
 daemon ypbind $OTHER_YPBIND_OPTS
if [ $RETVAL -ne 0 ]; then
logger -t ypbind "failed to start!"
echo -n $"Binding NIS service: "
# the following fixes problems with the init scripts continuing
# even when we are really not bound yet to a server, and then things
# that need NIS fail.
while [ $timeout -gt 0 ]; do
 /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind && \
/usr/bin/ypwhich > /dev/null 2>&1
if [ $RETVAL -eq 0 ]; then
echo -n "..."
# ypwhich has a hardcode 15sec timeout
# so subtract that from NISTIMEOUT to
# to see of we should continue to wait
 timeout=`expr $timeout - 15`
 ypbind is started as a daemon at this point, so the script will continue
past this point. At that instant, ypbind is not yet registered with rpcbind
 If ypbind is NOT yet registered with rpcbind, the first part of the "&"
condition will fail, and the ypwhich will NOT be executed.
 The script *assumes* that the ypwhich call will delay 15 seconds, but since
it was not executed, no delay occurs, and the loop will immediately continue.
As a result, the (default 3) iterations of the loop which are supposed to take
45 seconds happen pretty much instantaneously and the loop terminates. The
script then assumes that the ypbind daemon isn't running properly and kills it.
The simple and stupid solution is to put a "sleep 1" before the loop, to give
ypbind plenty of time to start and register with rpcbind. The better solution
would be to split the check of rpcbind and the ypwhich into 2 lines, and in the
case that rpcbind fails to show ypbind then delay and try again - however, this
will *still* cause the start-up to be delayed by 1 second in the failure case.
Even better would be to really check the elapsed time rather than assuming the
15 second timeout, and actually wait the specified time - this might be done by
starting a "sleep 45" as a backgrounded command and looking for it to terminate.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. service ypbind restart or service ypbind start
ypbind starts and then is killed by the startup script. (see discussion)
I have run into this same issue after installing fedora core 8. My work around
was to add a sleep 1 statement. The problem is that the failure only occurs (at
least with me) during the bootup stage. After the system booted up, I would log
in as root and execute '/etc/rc.d/init.d/ypbind start' and it would come right
up. Thus it was a bit deceptive as to whether the startup script was busted or
not. Anyway, my sleep 1 added to the script (I put it right after the echo -n
"...") fixed my problem.
I did not run into this problem when I first installed Fedora 8 on November 12.
Since then a number of updates have been installed. Now when I reboot, the
boot time script that starts ypbind reports failure. When I start ypbind
manually, it works.
From watching the boot, I can see the script that is checking whether ypbind
started correctly is not waiting anything like 45 seconds. I think it didn't
wait at all, but I can't say for sure. This is running on a computer with 2 CPU's.
The Problem persists.
I have the same problem as comment #2
Fixed in ypbind-1.20.4-3.fc9
will this be coming to Fedora 8?