Fixed ypbind-post-waitbind to stop the service when binding is not success

This commit is contained in:
Honza Horák 2011-11-16 17:26:25 +01:00
parent 4e0810ffff
commit fe120cda2f
2 changed files with 21 additions and 6 deletions

View File

@ -16,12 +16,14 @@ logger -t ypbind $"Binding NIS service"
timeout=$NISTIMEOUT
firsttime=1
rpcbound=0
SECONDS=0
retval=0
while [ $SECONDS -lt $timeout ] || [ $firsttime -eq 1 ] ; do
firsttime=0
if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind
then
firsttime=0
rpcbound=1
/usr/bin/ypwhich > /dev/null 2>&1
retval=$?
if [ $retval -eq 0 ]; then
@ -34,10 +36,20 @@ done
logger -t ypbind "Binding took $SECONDS seconds"
if [ $retval -eq 0 ]; then
logger -t ypbind \
"NIS domain: `domainname`, NIS server: `ypwhich 2> /dev/null`"
if [ $rpcbound -eq 0 ]; then
logger -t ypbind \
"NIS domain: `domainname`, ypbind not registered with rpcbind."
else
logger -t ypbind \
"NIS domain: `domainname`, NIS server: `ypwhich 2> /dev/null`"
fi
else
logger -t ypbind \
"NIS server for domain `domainname` is not responding."
logger -t ypbind \
"NIS server for domain `domainname` is not responding."
logger -t ypbind \
"Killing ypbind with PID $MAINPID."
kill SIGTERM $MAINPID
fi
exit $retval

View File

@ -1,7 +1,7 @@
Summary: The NIS daemon which binds NIS clients to an NIS domain
Name: ypbind
Version: 1.33
Release: 8%{?dist}
Release: 9%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
@ -117,6 +117,9 @@ fi
%doc README NEWS COPYING
%changelog
* Wed Nov 16 2011 Honza Horak <hhorak@redhat.com> - 3:1.33-9
- Fixed ypbind-post-waitbind to stop the service when binding is not success
* Tue Nov 15 2011 Honza Horak <hhorak@redhat.com> - 3:1.33-8
- Fixed ypbind-post-waitbind to handle long rpcinfo requests
Resolves: #624688