[Linux-cluster] clustering NIS, incorrect return value of ypserv, ypxfrd init scripts
linux-cluster at merctech.com
linux-cluster at merctech.com
Thu Sep 25 15:26:27 UTC 2008
I'm in the process of setting up a 2-node CentOS 5.2 cluster. Among other
things, this cluster will act as an HA NIS slave.
The setup of the NIS service was fairly painless, except that some NIS init
scripts (ypbind, ypxfrd) incorrectly set a return value of "0" in response to
the "status" option, regardless of the actual daemon status.
This appears to be a bug in the init scripts--they don't use the return value
from the /etc/init.d/rc.d/functions "status" check as their exit value.
Here's an example from /etc/init.d/ypserv:
---------------------------------------------------------
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status ypserv
;;
restart|reload)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/ypserv ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL
---------------------------------------------------------
Note that /etc/init.d/ypserv exits with the value of $RETVAL, which the "status"
block leaves unset (hence, 0). This means that if the ypserv daemon is dead,
then clurgmgrd will never detect the error and will not restart or relocate the
service.
The simple fix (in my case) was to add:
RETVAL=$?
after the "status" check.
Perhaps this should be submitted as a bug report to Redhat.
-----
Mark Bergman Biker, Rock Climber, Unix mechanic, IATSE #1 Stagehand
http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=bergman%40merctech.com
More information about the Linux-cluster
mailing list