Bug 211249 - named init script does not stop named
Summary: named init script does not stop named
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: bind
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-18 03:11 UTC by Allen Kistler
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: bind-9.3.3-0.2.rc2.fc5
Clone Of:
Environment:
Last Closed: 2006-11-14 14:04:30 UTC
Type: ---
Embargoed:


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

Description Allen Kistler 2006-10-18 03:11:42 UTC
Description of problem:
If rndc fails, named fails to stop.

Version-Release number of selected component (if applicable):
bind-9.3.3-0.1.rc2.fc5

How reproducible:
Always

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-18 03:11:44 UTC
Created attachment 138743 [details]
Patch to /etc/init.d/named

Comment 2 Martin Stransky 2006-10-23 11:19:40 UTC
hmm, not sure if we want to kill named in any case...need to check it.

Comment 3 Martin Stransky 2006-10-26 15:08:48 UTC
Could you please run "/usr/sbin/rndc stop" and attach an output here?

Comment 4 Trevor Cordes 2006-10-27 15:35:15 UTC
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 07:34:59 UTC
Contents of named.conf include
// Disable rndc
controls { };

So "rndc stop" yields
rndc: connect failed: 127.0.0.1#953: 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 07:20:20 UTC
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 09:27:02 UTC
Just got the erratum from updates, rather than testing.
Works okay.

Comment 8 Martin Stransky 2006-11-10 13:53:13 UTC
So does the bind-9.3.3-0.2.rc2.fc5 work for you?

Comment 9 Allen Kistler 2006-11-12 00:24:43 UTC
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 14:04:30 UTC
okay, closing as fixed.


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