Fix init script timing again

This commit is contained in:
vcrhonek 2008-05-23 12:37:20 +00:00
parent d5fb25224d
commit 74c49f972a
2 changed files with 14 additions and 16 deletions

View File

@ -82,29 +82,23 @@ start() {
# even when we are really not bound yet to a server, and then things # even when we are really not bound yet to a server, and then things
# that need NIS fail. # that need NIS fail.
timeout=10 timeout=10
failure=0 firsttime=1
while [ $timeout -gt 0 ]; do SECONDS=0
while [ $SECONDS -lt $timeout ]; do
if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind
then then
if [ $failure -eq 1 ]; then if [ $firsttime -eq 1 ]; then
# reset timeout # reset timeout
timeout=$NISTIMEOUT timeout=$NISTIMEOUT
failure=0 firsttime=0
fi fi
/usr/bin/ypwhich > /dev/null 2>&1 /usr/bin/ypwhich > /dev/null 2>&1
RETVAL=$? RETVAL=$?
if [ $RETVAL -eq 0 ]; then if [ $RETVAL -eq 0 ]; then
break; break;
fi fi
# ypwhich has a hardcode 15sec timeout
# so subtract that from NISTIMEOUT to
# to see of we should continue to wait
timeout=`expr $timeout - 15`
else # wait for ypbind to get started
sleep 2
timeout=`expr $timeout - 2`
failure=1
fi fi
sleep 2
echo -n "..." echo -n "..."
done done
if [ $RETVAL -eq 0 ]; then if [ $RETVAL -eq 0 ]; then

View File

@ -1,7 +1,7 @@
Summary: The NIS daemon which binds NIS clients to an NIS domain. Summary: The NIS daemon which binds NIS clients to an NIS domain.
Name: ypbind Name: ypbind
Version: 1.20.4 Version: 1.20.4
Release: 3%{?dist} Release: 4%{?dist}
License: GPL License: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{PACKAGE_VERSION}.tar.bz2 Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{PACKAGE_VERSION}.tar.bz2
@ -91,6 +91,10 @@ exit 0
%doc README NEWS %doc README NEWS
%changelog %changelog
* Fri May 23 2008 Vitezslav Crhonek <vcrhonek@redhat.com> - 3:1.20.4-4
- Fix init script timing again
Resolves: #446356
* Mon Feb 4 2008 Vitezslav Crhonek <vcrhonek@redhat.com> - 3:1.20.4-3 * Mon Feb 4 2008 Vitezslav Crhonek <vcrhonek@redhat.com> - 3:1.20.4-3
- Fix ypbind startup fails because of timeout error in init script - Fix ypbind startup fails because of timeout error in init script
Resolves: #430409 Resolves: #430409