summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install/share/bind.named.conf.template1
-rw-r--r--install/tools/ipa-upgradeconfig45
2 files changed, 45 insertions, 1 deletions
diff --git a/install/share/bind.named.conf.template b/install/share/bind.named.conf.template
index b12df593a..e4ce60583 100644
--- a/install/share/bind.named.conf.template
+++ b/install/share/bind.named.conf.template
@@ -15,6 +15,7 @@ options {
allow-recursion { any; };
tkey-gssapi-keytab "/etc/named.keytab";
+ pid-file "/run/named/named.pid";
};
/* If you want to enable debugging, eg. using the 'rndc trace' command,
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig
index f5652139d..c690544fa 100644
--- a/install/tools/ipa-upgradeconfig
+++ b/install/tools/ipa-upgradeconfig
@@ -516,6 +516,47 @@ def named_update_gssapi_configuration():
sysupgrade.set_upgrade_state('named.conf', 'gssapi_updated', True)
return True
+def named_update_pid_file():
+ """
+ Make sure that named reads the pid file from the right file
+ """
+ root_logger.info('[Updating pid-file configuration in DNS]')
+
+ if not bindinstance.named_conf_exists():
+ # DNS service may not be configured
+ root_logger.info('DNS is not configured')
+ return False
+
+ if sysupgrade.get_upgrade_state('named.conf', 'pid-file_updated'):
+ root_logger.debug('Skip pid-file configuration check')
+ return False
+
+ try:
+ pid_file = bindinstance.named_conf_get_directive('pid-file',
+ bindinstance.NAMED_SECTION_OPTIONS)
+ except IOError, e:
+ root_logger.error('Cannot retrieve pid-file option from %s: %s',
+ bindinstance.NAMED_CONF, e)
+ return False
+ else:
+ if pid_file:
+ root_logger.debug('pid-file configuration already updated')
+ sysupgrade.set_upgrade_state('named.conf', 'pid-file_updated', True)
+ return False
+
+ try:
+ bindinstance.named_conf_set_directive('pid-file', '/run/named/named.pid',
+ bindinstance.NAMED_SECTION_OPTIONS)
+ except IOError, e:
+ root_logger.error('Cannot update pid-file configuration in %s: %s',
+ bindinstance.NAMED_CONF, e)
+ return False
+ else:
+ root_logger.debug('pid-file configuration updated')
+
+ sysupgrade.set_upgrade_state('named.conf', 'pid-file_updated', True)
+ return True
+
def enable_certificate_renewal(ca):
"""
@@ -808,7 +849,9 @@ def main():
changed_psearch = named_enable_psearch()
changed_autoincrement = named_enable_serial_autoincrement()
changed_gssapi_conf = named_update_gssapi_configuration()
- if changed_psearch or changed_autoincrement or changed_gssapi_conf:
+ changed_pid_file_conf = named_update_pid_file()
+ if (changed_psearch or changed_autoincrement or changed_gssapi_conf
+ or changed_pid_file_conf):
# configuration has changed, restart the name server
root_logger.info('Changes to named.conf have been made, restart named')
bind = bindinstance.BindInstance(fstore)