From 22345c5ddf22924c4c4b7a644a3f1a2b1747f565 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 18 Aug 2015 13:04:09 +0200 Subject: [PATCH] client: add -d option to print debug messages --- chrony.texi.in | 3 +++ chronyc.1.in | 3 +++ client.c | 4 +++- configure | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/chrony.texi.in b/chrony.texi.in index 15a94c8..e04d029 100644 --- a/chrony.texi.in +++ b/chrony.texi.in @@ -3265,6 +3265,9 @@ This defaults to the compiled-in default; there would rarely be a need to change this. @item -n This option disables resolving IP addresses to hostnames. +@item -d +This option enables printing of debugging messages (if compiled with debugging +support). @item -4 With this option hostnames will be resolved only to IPv4 addresses. @item -6 diff --git a/chronyc.1.in b/chronyc.1.in index 4a796cc..acd76ad 100644 --- a/chronyc.1.in +++ b/chronyc.1.in @@ -32,6 +32,9 @@ specify port-number \fB\-n\fR display raw IP addresses (don't attempt to look up hostnames) .TP +\fB\-d\fR +print debugging messages (if compiled with debugging support) +.TP \fB\-4\fR resolve hostnames only to IPv4 addresses .TP diff --git a/client.c b/client.c index 9600fe3..41badc8 100644 --- a/client.c +++ b/client.c @@ -2797,6 +2797,8 @@ main(int argc, char **argv) } } else if (!strcmp(*argv, "-a")) { auto_auth = 1; + } else if (!strcmp(*argv, "-d")) { + log_debug_enabled = 1; } else if (!strcmp(*argv, "-m")) { multi = 1; } else if (!strcmp(*argv, "-n")) { @@ -2810,7 +2812,7 @@ main(int argc, char **argv) return 0; } else if (!strncmp(*argv, "-", 1)) { LOG(LOGS_ERR, LOGF_Client, - "Usage: %s [-h HOST] [-p PORT] [-n] [-4|-6] [-a] [-f FILE] [-m] [COMMAND]", + "Usage: %s [-h HOST] [-p PORT] [-n] [-d] [-4|-6] [-a] [-f FILE] [-m] [COMMAND]", progname); return 1; } else { diff --git a/configure b/configure index ed0d795..135a4de 100755 --- a/configure +++ b/configure @@ -768,9 +768,9 @@ add_def DEFAULT_CONF_FILE "\"$SYSCONFDIR/chrony.conf\"" add_def DEFAULT_USER "\"$default_user\"" add_def MAIL_PROGRAM "\"$mail_program\"" -common_features="`get_features ASYNCDNS IPV6 SECHASH`" +common_features="`get_features ASYNCDNS IPV6 SECHASH DEBUG`" chronyc_features="`get_features READLINE`" -chronyd_features="`get_features CMDMON NTP REFCLOCK RTC PRIVDROP DEBUG`" +chronyd_features="`get_features CMDMON NTP REFCLOCK RTC PRIVDROP`" add_def CHRONYC_FEATURES "\"$chronyc_features $common_features\"" add_def CHRONYD_FEATURES "\"$chronyd_features $common_features\"" echo "Features : $chronyd_features $chronyc_features $common_features"