Bug 211249 - named init script does not stop named
named init script does not stop named
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2006-10-17 23:11 EDT by Allen Kistler
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: bind-9.3.3-0.2.rc2.fc5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-11-14 09:04:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to /etc/init.d/named (595 bytes, patch)
2006-10-17 23:11 EDT, Allen Kistler
no flags Details | Diff

  None (edit)
Description Allen Kistler 2006-10-17 23:11:42 EDT
Description of problem:
If rndc fails, named fails to stop.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. /etc/init.d/named start
2. /etc/init.d/named stop
Actual results:
Stopping named:  [FAILED]

Expected results:
Stopping named:  [  OK  ]

Additional info:
There's an error in the test of the rndc RETVAL which guarantees named will
always fail to stop if rndc fails to stop it.  Patch attached.

The patch also corrects a typo in a comment.
Comment 1 Allen Kistler 2006-10-17 23:11:44 EDT
Created attachment 138743 [details]
Patch to /etc/init.d/named
Comment 2 Martin Stransky 2006-10-23 07:19:40 EDT
hmm, not sure if we want to kill named in any case...need to check it.
Comment 3 Martin Stransky 2006-10-26 11:08:48 EDT
Could you please run "/usr/sbin/rndc stop" and attach an output here?
Comment 4 Trevor Cordes 2006-10-27 11:35:15 EDT
Not sure if this helps, but this problem occurs if your named.conf rndc key does
not match your rndc.key one.  Obviously rndc will fail but you should still be
able to stop named somehow!
Comment 5 Allen Kistler 2006-10-28 03:34:59 EDT
Contents of named.conf include
// Disable rndc
controls { };

So "rndc stop" yields
rndc: connect failed: connection refused

The point is that there's a bug in the logic of the init script whether you use
rndc or not.  Without changing -eq to -ne in the test of $RETVAL from rndc, the
if block is useless.

If rndc succeeds, then the if block gets executed, including testing if named is
still running, which it isn't, so the script exits the block.

If rndc fails, the block is skipped in its entirety, not meeting the intent of
the block to act as a failsafety.

OTOH if you're changing the intent of the block, then the bug is that the if
statement exists at all.  Just execute the block no matter what.
Comment 6 Martin Stransky 2006-10-30 02:20:20 EST
Please check the latest test update for FC5 (bind-9.3.3-0.2.rc2.fc5). There is a
hack there what you have suggested.
Comment 7 Allen Kistler 2006-11-07 04:27:02 EST
Just got the erratum from updates, rather than testing.
Works okay.
Comment 8 Martin Stransky 2006-11-10 08:53:13 EST
So does the bind-9.3.3-0.2.rc2.fc5 work for you?
Comment 9 Allen Kistler 2006-11-11 19:24:43 EST
Yes.  bind-9.3.3-0.2.rc2.fc5 is the version I got from updates.  It works.
Comment 10 Martin Stransky 2006-11-14 09:04:30 EST
okay, closing as fixed.

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