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 | a637e21d8810f14cbc4d212f13206fc08dfd1f86 (patch) | |
tree | 251b6cf0b74a1821cde3a2b4a0b9cdf07a16997b /ipa-client | |
parent | 7e5a0be8d81c3648a0163ff454cd963eadd70ea9 (diff) | |
download | freeipa-a637e21d8810f14cbc4d212f13206fc08dfd1f86.tar.gz freeipa-a637e21d8810f14cbc4d212f13206fc08dfd1f86.tar.xz freeipa-a637e21d8810f14cbc4d212f13206fc08dfd1f86.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')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-install | 5 | ||||
-rw-r--r-- | ipa-client/ipaclient/ntpconf.py | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index a1564583c..96b30b486 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -2388,12 +2388,13 @@ def install(options, env, fstore, statestore): ntp_servers = options.ntp_servers for s in ntp_servers: - synced_ntp = ipaclient.ntpconf.synconce_ntp(s) + synced_ntp = ipaclient.ntpconf.synconce_ntp(s, options.debug) if synced_ntp: break if not synced_ntp and not options.ntp_servers: - synced_ntp = ipaclient.ntpconf.synconce_ntp(cli_server[0]) + synced_ntp = ipaclient.ntpconf.synconce_ntp(cli_server[0], + options.debug) if not synced_ntp: root_logger.warning("Unable to sync time with NTP " + "server, assuming the time is in sync. Please check " + 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 |