diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2015-03-30 12:29:04 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-07-20 14:19:08 +0000 |
commit | 1ec174b92d2a734bd5859689bc67de5974270b06 (patch) | |
tree | e1c4384c88b8defa39ddd596dd39525e3f15c12c /ipa-client/ipaclient/ntpconf.py | |
parent | 37b1af9a7cea72f41ac468ab80259f39b0a7b3db (diff) | |
download | freeipa-1ec174b92d2a734bd5859689bc67de5974270b06.tar.gz freeipa-1ec174b92d2a734bd5859689bc67de5974270b06.tar.xz freeipa-1ec174b92d2a734bd5859689bc67de5974270b06.zip |
enable debugging of ntpd during client installation
When installing IPA client in debug mode, the ntpd command spawned during
initial time-sync with master KDC will also run in debug mode.
https://fedorahosted.org/freeipa/ticket/4931
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipa-client/ipaclient/ntpconf.py')
-rw-r--r-- | ipa-client/ipaclient/ntpconf.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipa-client/ipaclient/ntpconf.py b/ipa-client/ipaclient/ntpconf.py index c22fba401..9a7db6544 100644 --- a/ipa-client/ipaclient/ntpconf.py +++ b/ipa-client/ipaclient/ntpconf.py @@ -137,7 +137,7 @@ def config_ntp(ntp_servers, fstore = None, sysstore = None): services.knownservices.ntpd.restart() -def synconce_ntp(server_fqdn): +def synconce_ntp(server_fqdn, debug=False): """ Syncs time with specified server using ntpd. Primarily designed to be used before Kerberos setup @@ -150,13 +150,16 @@ def synconce_ntp(server_fqdn): return False tmp_ntp_conf = ipautil.write_tmp_file('server %s' % server_fqdn) + args = [ntpd, '-qgc', tmp_ntp_conf.name] + if debug: + args.append('-d') try: # The ntpd command will never exit if it is unable to reach the # server, so timeout after 15 seconds. timeout = 15 root_logger.info('Attempting to sync time using ntpd. ' 'Will timeout after %d seconds' % timeout) - ipautil.run([ntpd, '-qgc', tmp_ntp_conf.name], timeout=timeout) + ipautil.run(args, timeout=timeout) return True except ipautil.CalledProcessError: return False |