Gerald Hanuer
2016-02-07 14:18:46 UTC
Hello tech@,
https://marc.info/?l=openbsd-misc&m=145479483809799&w=2
the clock has been adjusted by the displayed number of \
seconds each time the message is printed.
What I beleive is trying to be conveyed to the "sysadmin" \
is, the current offset of the local clock \
relative to the time server.
This is the output with the included patch applied.
ntpd[17167]: adjusting local clock (offset -15.877748s)
ntpd[17167]: adjusting local clock (offset -14.532992s)
ntpd[17167]: adjusting local clock (offset -14.216236s)
The patch takes cues from code else where in ntpd.c
strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %Z %Y",
localtime(&tval));
log_info("set local clock to %s (offset %fs)", buf, d);
This is the output of that existing code.
ntpd[20576]: set local clock to Sun Feb 7 01:38:35 UTC 2016 (offset
-0.262911s)
Regards,
Gerald Hanuer
Index: ntpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v
retrieving revision 1.106
diff -u -p -r1.106 ntpd.c
--- ntpd.c 2 Feb 2016 17:51:11 -0000 1.106
+++ ntpd.c 7 Feb 2016 08:52:34 -0000
@@ -443,9 +443,9 @@ ntpd_adjtime(double d)
d += getoffset();
if (d >= (double)LOG_NEGLIGIBLE_ADJTIME / 1000 ||
d <= -1 * (double)LOG_NEGLIGIBLE_ADJTIME / 1000)
- log_info("adjusting local clock by %fs", d);
+ log_info("adjusting local clock (offset %fs)", d);
else
- log_debug("adjusting local clock by %fs", d);
+ log_debug("adjusting local clock (offset %fs)", d);
d_to_tv(d, &tv);
if (adjtime(&tv, &olddelta) == -1)
log_warn("adjtime failed");
https://marc.info/?l=openbsd-misc&m=145479483809799&w=2
ntpd[9279]: adjusting local clock by 9.096751s
ntpd[9279]: adjusting local clock by 7.971861s
ntpd[9279]: adjusting local clock by 6.838999s
I don't think that clock is adjusted "by" that values.
If that would be the case, I guess clock would be far faster synced.
Wording of the logged messages seems to imply that \ntpd[9279]: adjusting local clock by 7.971861s
ntpd[9279]: adjusting local clock by 6.838999s
I don't think that clock is adjusted "by" that values.
If that would be the case, I guess clock would be far faster synced.
the clock has been adjusted by the displayed number of \
seconds each time the message is printed.
What I beleive is trying to be conveyed to the "sysadmin" \
is, the current offset of the local clock \
relative to the time server.
This is the output with the included patch applied.
ntpd[17167]: adjusting local clock (offset -15.877748s)
ntpd[17167]: adjusting local clock (offset -14.532992s)
ntpd[17167]: adjusting local clock (offset -14.216236s)
The patch takes cues from code else where in ntpd.c
strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %Z %Y",
localtime(&tval));
log_info("set local clock to %s (offset %fs)", buf, d);
This is the output of that existing code.
ntpd[20576]: set local clock to Sun Feb 7 01:38:35 UTC 2016 (offset
-0.262911s)
Regards,
Gerald Hanuer
Index: ntpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v
retrieving revision 1.106
diff -u -p -r1.106 ntpd.c
--- ntpd.c 2 Feb 2016 17:51:11 -0000 1.106
+++ ntpd.c 7 Feb 2016 08:52:34 -0000
@@ -443,9 +443,9 @@ ntpd_adjtime(double d)
d += getoffset();
if (d >= (double)LOG_NEGLIGIBLE_ADJTIME / 1000 ||
d <= -1 * (double)LOG_NEGLIGIBLE_ADJTIME / 1000)
- log_info("adjusting local clock by %fs", d);
+ log_info("adjusting local clock (offset %fs)", d);
else
- log_debug("adjusting local clock by %fs", d);
+ log_debug("adjusting local clock (offset %fs)", d);
d_to_tv(d, &tv);
if (adjtime(&tv, &olddelta) == -1)
log_warn("adjtime failed");