[pkg-ntp-maintainers] Bug#542070: ntp should preserve local clocks when peers are given by dhcp

Joerg Dorchain joerg at dorchain.net
Mon Aug 17 16:57:06 UTC 2009


Package: ntp
Version: 1:4.2.6p6+dfsg-2
Tags: patch

Hello,

ntp currently installs a script as
/etc/dhcp3/dhclient-exit-hooks.d/ntp This script takes an
existing /etc/ntp.conf and replaces all peer or server statements
in it by those given via dhcp. All configured local clocks are
overwritten, leading to undesried behaviour.

IMHO it should preserve configured local clocks, i.e. server
statements starting with 127 as the peer address.

The attached patch is a short hack that implements this.

IMHO a more sophisticated script is needed that maybe preserves
all servers with corresponding fudge lines (local clocks) and
adds restrict line allowing time exchange with the ntp peers
received by dhcp.

Bye,

Joerg


--- /tmp/ntp	2009-08-17 18:42:14.543903299 +0200
+++ ntp	2009-08-17 18:43:37.964343565 +0200
@@ -40,7 +40,7 @@
 		echo "server $server iburst"
 	  done
 	  echo
-	  sed -r -e '/^ *(server|peer).*$/d' $NTP_CONF
+	  sed -r -e '/^ *(server|peer) +([^1]|[^1][^2]|[^1][^2][^7]).*$/d' $NTP_CONF
 	) >>$tmp
 	
 	mv $tmp $NTP_DHCP_CONF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 266 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ntp-maintainers/attachments/20090817/90393850/attachment.pgp>


More information about the pkg-ntp-maintainers mailing list