[Git][NTPsec/ntpsec][master] 2 commits: Add script useful for timing ntpd startup

Hal Murray gitlab at mg.gitlab.com
Sun Aug 20 06:45:36 UTC 2017


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
3a1b0817 by Hal Murray at 2017-08-20T06:37:20+00:00
Add script useful for timing ntpd startup

- - - - -
e436fa68 by Hal Murray at 2017-08-20T06:44:35+00:00
Fix for iburst on DNS for both server and pool

- - - - -


2 changed files:

- ntpd/ntp_proto.c
- + tests/time-startup.sh


Changes:

=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2406,7 +2406,7 @@ fast_xmit(
 
 
 /*
- * server_take_dns - process DNS query for server.
+ * dns_take_server - process DNS query for server.
  */
 void
 dns_take_server(
@@ -2446,11 +2446,13 @@ dns_take_server(
 	server->hpoll = server->minpoll;
 	server->nextdate = current_time;
 	peer_xmit(server);
+	if (server->flags & FLAG_IBURST)
+	  server->retry = NTP_RETRY;
 	poll_update(server, server->hpoll);
 }
 
 /*
- pool_take_dns - process DNS query for pool.
+ dns_take_pool - process DNS query for pool.
  */
 void
 dns_take_pool(
@@ -2478,6 +2480,8 @@ dns_take_pool(
 		FLAG_PREEMPT | (FLAG_IBURST & pool->flags),
 		MDF_UCAST | MDF_UCLNT, 0, 0, false);
 	peer_xmit(peer);
+	if (peer->flags & FLAG_IBURST)
+	  peer->retry = NTP_RETRY;
 	poll_update(peer, peer->hpoll);
 
 	restrict_mask = restrictions(&peer->srcadr);


=====================================
tests/time-startup.sh
=====================================
--- /dev/null
+++ b/tests/time-startup.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Hack to measure startup timing
+
+# FIXME - needed on Fedora
+export PYTHONPATH=/usr/local/lib/python2.7/site-packages
+
+if test "$#" -ge 1
+then
+  CONF=$1
+else
+  CONF=/etc/ntp.conf
+fi
+
+
+
+killall ntpd
+sleep 5
+
+time /usr/local/sbin/ntpd -u ntp:ntp -g -c $CONF
+/usr/local/bin/ntpwait -v -n 999 -s 1
+
+/usr/local/bin/ntpq -np
+



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/10b077af440317800332006358eb591379fa0509...e436fa68ed97f509bfc0bfef804b8f1a66082b5e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/10b077af440317800332006358eb591379fa0509...e436fa68ed97f509bfc0bfef804b8f1a66082b5e
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170820/434f1d0b/attachment.html>


More information about the vc mailing list