RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 997743 - 'rndc status' generates warning " key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf)"
Summary: 'rndc status' generates warning " key file (/etc/rndc.key) exists, but using ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: bind
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 6.5
Assignee: Tomáš Hozza
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 841316 (view as bug list)
Depends On:
Blocks: 1070830
TreeView+ depends on / blocked
 
Reported: 2013-08-16 06:33 UTC by Nilesh Parmar
Modified: 2018-12-09 17:07 UTC (History)
2 users (show)

Fixed In Version: bind-9.8.2-0.27.rc1.el6
Doc Type: Bug Fix
Doc Text:
Cause: The named initscript checks only the existence of rndc.key file on the server start-up. Consequence: User having a custom rndc configuration may specify the used key in the configuration or include the key from a file. In such situation the initsctipt generates a rndc.key even if there is custom rndc configuration. Fix: The initscript was fixed to additionally check the existence of the rndc configuration before generating the rndc.key file. Result: As a result, if user has a custom rndc configuration, then the initscript will not generate a rndc.key.
Clone Of:
Environment:
Last Closed: 2014-10-14 04:35:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed fix (555 bytes, patch)
2013-08-16 10:58 UTC, Tomáš Hozza
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1373 0 normal SHIPPED_LIVE bind bug fix and enhancement update 2014-10-14 01:11:10 UTC

Description Nilesh Parmar 2013-08-16 06:33:44 UTC
Description of problem:

Feature was added in bind package (bug# 768798) which creates /etc/rndc.key (if the file /etc/rndc.key doesn't exist) when named started with init script required to run rndc commands.
However if rndc.conf file is created with rndc.key defined in it, then it will throw warning as:

WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf)

Version-Release number of selected component (if applicable):
bind-9.8.2-0.10.rc1.el6

How reproducible:
Always

Steps to Reproduce:
- Built the /etc/rndc file with rndc.key defined and run 'rndc status'

Actual results:
No warning should be logged

Expected results:
Warning getting logged.

init.d script for named should be updated to only generate rndc.key if both rndc.key and rndc.conf do not exist. Default bind install does not provide either files, so it is still appropriate to generate a rndc.key if it does not exist. However, the existence of rndc.conf should preclude the need to generate a rndc.key file.

Additional info:

rndc -c /etc/rndc.conf status works without a warning. However, this needs to work with the standard init.d script, so 'service named status' should run without a warning. 

The code snippet in question is this:

  if [ ! -s /etc/rndc.key ]; then
    # Generate rndc.key if doesn't exist
    echo -n $"Generating /etc/rndc.key:"
    if /usr/sbin/rndc-confgen -a > /dev/null 2>&1; then
      chmod 640 /etc/rndc.key
      chown root.named /etc/rndc.key
      [ -x /sbin/restorecon ] && /sbin/restorecon /etc/rndc.key
      success $"/etc/rndc.key generation"
      echo
    else
      failure $"/etc/rndc.key generation"
      echo
    fi
  fi

The first line should be modified to be:

  if [ ! -s /etc/rndc.conf -a ! -s /etc/rndc.key ]; then

Once that change is made, we can delete /etc/rndc.key and the warning goes away. Plus next time when named is restarted it will not create a new key. The above change is appropriate behavior, based on the ISC documentation that introduced the warning.

https://kb.isc.org/article/AA-00722/0/Why-does-rndc-log-warning-key-file-...-exists-but-using-default-configuration-file-rndc.conf.html

Comment 1 Tomáš Hozza 2013-08-16 10:55:39 UTC
I have no problem with the change and agree that it will solve the
issue.

Comment 2 Tomáš Hozza 2013-08-16 10:58:20 UTC
Created attachment 787215 [details]
Proposed fix

Comment 4 Tomáš Hozza 2014-04-23 14:21:32 UTC
*** Bug 841316 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2014-10-14 04:35:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1373.html


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