Bug 112506 - Incorrect return code of condrestart in /etc/rc.d/init.d/named
Summary: Incorrect return code of condrestart in /etc/rc.d/init.d/named
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: bind   
(Show other bugs)
Version: 3.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-12-21 20:00 UTC by NN Poster
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-29 11:42:31 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description NN Poster 2003-12-21 20:00:09 UTC
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 
appropriate.

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):
bind-9.2.2-21

How reproducible:
always when named is not running

Steps to Reproduce:
1. /etc/init.d/named stop
2. /etc/init.d/named condrestart
3. echo $?
  
Actual results:
1

Expected results:
0

Additional info:

Comment 1 NN Poster 2003-12-23 04:28:05 UTC
Minor correction: The correct path is /etc/rc.d/init.d/named, 
not /etc/init.d/rc.d/named

Comment 2 Daniel Walsh 2003-12-29 11:42:31 UTC
Fixed in bind-9.2.3-3 in rawhide.


Note You need to log in before you can comment on or make changes to this bug.