Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 163598

Summary: invalid stop() function in init.d/named script
Product: [Fedora] Fedora Reporter: Andy Shevchenko <andy>
Component: bindAssignee: Jason Vas Dias <jvdias>
Status: CLOSED DUPLICATE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-20 09:13:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Andy Shevchenko 2005-07-19 12:11:59 UTC
Description of problem:
The stop() function in init.d/named  script has illegal construction.
Next patch fix the problem.

stop() {
        # Stop daemons.
        echo -n $"Stopping $prog: "
-       /usr/sbin/rndc stop >/dev/null 2>&1 || pidof named >/dev/null &&
killproc named -TERM >/dev/null 2>&1
+       /usr/sbin/rndc stop >/dev/null 2>&1 || (pidof named >/dev/null
&& killproc named -TERM >/dev/null 2>&1)
        RETVAL=$?
...


Due to BASH interpretes

/usr/sbin/rndc stop >/dev/null 2>&1 || pidof named >/dev/null &&
killproc named -TERM >/dev/null 2>&1

as

(/usr/sbin/rndc stop >/dev/null 2>&1 || pidof named >/dev/null) &&
killproc named -TERM >/dev/null 2>&1

instead of

/usr/sbin/rndc stop >/dev/null 2>&1 || (pidof named >/dev/null &&
killproc named -TERM >/dev/null 2>&1)

we have occur error. 

'killproc named -TERM' returns error code, because of process is down already.

Also files in /var/run/ are not removed and error present when next start is 
executed.

Version-Release number of selected component (if applicable):
Last official update of FC3.

Additional info:
I should like to make some note. Above text is translated from russian and 
posted here by me. However, original author of the analysis are "Sergei 
LITVINENKO" <slitvinenko@voliacable.com>.

Comment 1 Jason Vas Dias 2005-07-19 16:48:48 UTC
This is now fixed with bind-9.2.5-3, to be released as an FC-3 update today.

Comment 2 Andy Shevchenko 2005-07-20 09:13:45 UTC

*** This bug has been marked as a duplicate of 154335 ***