Description of problem:
Action "condrestart" in /etc/init.d/rc.d/named will return incorrect
code if a restart is not needed. This is due to the fact that the
action is implemented as:
[ -e /var/lock/subsys/named ] && restart
If the lock file exists then the return code of the action is equal
to the return code of "restart", which is appropriate. However, if
lock file does not exist then the return code of the action is equal
to the return code of the failed test [ -e ... ], which is not
Several fixes are possible:
1. Replace the action implementation with:
[ ! -e /var/lock/subsys/named ] || restart
2. Replace the action implementation with:
if [ -e /var/lock/subsys/named ]; then restart; fi
3. Change the script exit from "exit $?" to "exit $RETVAL".
Version-Release number of selected component (if applicable):
always when named is not running
Steps to Reproduce:
1. /etc/init.d/named stop
2. /etc/init.d/named condrestart
3. echo $?
Minor correction: The correct path is /etc/rc.d/init.d/named,
Fixed in bind-9.2.3-3 in rawhide.