diff options
author | Adam Misnyovszki <amisnyov@redhat.com> | 2014-04-18 15:44:11 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-05-27 13:05:53 +0200 |
commit | 71c6d2f1eb9610a0e0a994a6cfd78fdf9bb9d1fa (patch) | |
tree | 1c176584565a174bdf47cc3e9a318b609bc3b11e /ipaserver/install/installutils.py | |
parent | d6a4da30de37b2a3f1a3b4b8f8dd6dc0da3e1b50 (diff) | |
download | freeipa-71c6d2f1eb9610a0e0a994a6cfd78fdf9bb9d1fa.tar.gz freeipa-71c6d2f1eb9610a0e0a994a6cfd78fdf9bb9d1fa.tar.xz freeipa-71c6d2f1eb9610a0e0a994a6cfd78fdf9bb9d1fa.zip |
Call generate-rndc-key.sh during ipa-server-install
Since systemd has by default a 2 minute timeout to start
a service, the end of ipa-server-install might fail
because starting named times out. This patch ensures that
generate-rndc-key.sh runs before named service restart.
Also, warning message is displayed before KDC install and
generate-rndc-key.sh, if there is a lack of entropy, to
notify the user that the process could take more time
than expected.
Modifications done by Martin Kosek:
- removed whitespace at the end of installutils.py
- the warning in krbinstance.py moved right before the step
requiring entropy
- slightly reworded the warning message
https://fedorahosted.org/freeipa/ticket/4210
Reviewed-By: Martin Kosek <mkosek@redhat.com>
Diffstat (limited to 'ipaserver/install/installutils.py')
-rw-r--r-- | ipaserver/install/installutils.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index daf81e890..7f15d3769 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -41,7 +41,7 @@ from ipalib.util import validate_hostname from ipapython import config from ipalib import errors from ipapython.dn import DN -from ipaserver.install import certs +from ipaserver.install import certs, service from ipapython import services as ipaservices # Used to determine install status @@ -846,3 +846,21 @@ def stopped_service(service, instance_name=""): finally: root_logger.debug('Starting %s%s.', service, log_instance_name) ipaservices.knownservices[service].start(instance_name) + +def check_entropy(): + ''' + Checks if the system has enough entropy, if not, displays warning message + ''' + try: + with open('/proc/sys/kernel/random/entropy_avail', 'r') as efname: + if int(efname.read()) < 200: + emsg = 'WARNING: Your system is running out of entropy, ' \ + 'you may experience long delays' + service.print_msg(emsg) + root_logger.debug(emsg) + except IOError as e: + root_logger.debug("Could not open /proc/sys/kernel/random/entropy_avail: %s" % \ + e) + except ValueError as e: + root_logger.debug("Invalid value in /proc/sys/kernel/random/entropy_avail %s" % \ + e) |