From 6fb31d37a8a1581efbbdcf032f81a1f6f66a55b1 Mon Sep 17 00:00:00 2001 From: Andy Boyett Date: Mon, 14 Jan 2008 10:38:27 +0000 Subject: [PATCH] packages: Use OpenWrt ntp vendor pool in default configs. (Cleaned whitespace too.) SVN-Revision: 10189 --- net/chrony/Makefile | 2 +- net/chrony/files/ntpd.config | 4 +- net/chrony/files/ntpd.hotplug | 12 ++--- net/chrony/files/ntpd.init | 64 +++++++++++++-------------- net/ntpclient/Makefile | 4 +- net/ntpclient/files/ntpclient.config | 4 +- net/ntpclient/files/ntpclient.hotplug | 2 +- net/ntpd/Makefile | 2 +- net/ntpd/files/ntp.conf | 8 ++-- net/ntpd/files/ntpd.init | 8 ++-- net/openntpd/Makefile | 2 +- net/openntpd/files/ntpd.conf | 5 ++- net/samba/files/smbd.config | 2 +- 13 files changed, 59 insertions(+), 60 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index f3a7549ba7..775ec203c0 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=chrony PKG_VERSION:=1.21 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= ftp://chrony.sunsite.dk/projects/chrony/ \ diff --git a/net/chrony/files/ntpd.config b/net/chrony/files/ntpd.config index 0ff5906898..7a3b6fd593 100644 --- a/net/chrony/files/ntpd.config +++ b/net/chrony/files/ntpd.config @@ -2,5 +2,5 @@ # Time servers and network(s) that may access the time service config ntpd - option TimeServers "0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org" - option ClientAccessFrom "lan" + option TimeServers "0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org 3.openwrt.pool.ntp.org" + option ClientAccessFrom "lan" diff --git a/net/chrony/files/ntpd.hotplug b/net/chrony/files/ntpd.hotplug index 9e06529e14..e2e5adfb29 100644 --- a/net/chrony/files/ntpd.hotplug +++ b/net/chrony/files/ntpd.hotplug @@ -9,13 +9,13 @@ EOF } [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && { - [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ - chrony_control online - } + [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ + chrony_control online + } } [ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] && { - [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ - chrony_control offline - } + [ -x $COMMAND ] && [ -n "$CHRONY_KEY" ] &&{ + chrony_control offline + } } diff --git a/net/chrony/files/ntpd.init b/net/chrony/files/ntpd.init index 21fa35d82c..dd9c9f5d8f 100644 --- a/net/chrony/files/ntpd.init +++ b/net/chrony/files/ntpd.init @@ -6,7 +6,7 @@ START=60 start() { [ ! -f /var/run/chronyd.pid ] && ( /usr/sbin/chronyd -f /etc/chrony/chrony.conf - + local NTP_SERVERS local NTP_SERVER local CLIENT_NETWORKS @@ -17,49 +17,45 @@ start() { CHRONY_KEY=$(awk '/^1 / { print $2; }' /etc/chrony/chrony.keys) include /lib/network scan_interfaces - + # Define servers and do a rapid series of time measurements # to get up to date ( - echo password $CHRONY_KEY - for NTP_SERVER in $NTP_SERVERS; do - echo add server $NTP_SERVER - done - echo burst 5/5 - ) | chronyc > /dev/null 2>&1 - - # ... wait until a reference ID is found ... - while chronyc tracking | grep 'Reference ID.*0.0.0.0' >/dev/null ; do sleep 1; done - - - # ... and finally, adjust the time in a single step - # and allow clients to access the server + echo password $CHRONY_KEY + for NTP_SERVER in $NTP_SERVERS; do + echo add server $NTP_SERVER + done + echo burst 5/5 + ) | chronyc > /dev/null 2>&1 + # ... wait until a reference ID is found ... + while chronyc tracking | grep 'Reference ID.*0.0.0.0' >/dev/null ; do sleep 1; done + # ... and finally, adjust the time in a single step + # and allow clients to access the server ( - echo password $CHRONY_KEY - echo makestep - for NETNAME in $CLIENT_NETWORKS; do - local INTERFACE - local IP - local NETMASK - local BROADCAST - local NETWORK - local PREFIX - - config_get INTERFACE "$NETNAME" ifname - if [ -n "$INTERFACE" ] ; then - eval $(ifconfig $INTERFACE | grep inet | sed -e 's/.*addr:/IP=/' -e 's/ .*Mask:/; NETMASK=/') - eval $(ipcalc $IP $NETMASK) - echo allow $NETWORK/$PREFIX - fi - done + echo password $CHRONY_KEY + echo makestep + for NETNAME in $CLIENT_NETWORKS; do + local INTERFACE + local IP + local NETMASK + local BROADCAST + local NETWORK + local PREFIX + + config_get INTERFACE "$NETNAME" ifname + if [ -n "$INTERFACE" ] ; then + eval $(ifconfig $INTERFACE | grep inet | sed -e 's/.*addr:/IP=/' -e 's/ .*Mask:/; NETMASK=/') + eval $(ipcalc $IP $NETMASK) + echo allow $NETWORK/$PREFIX + fi + done ) | chronyc > /dev/null 2>&1 - ) } stop() { [ -r /var/run/chronyd.pid ] && PID=$(cat /var/run/chronyd.pid) - [ -n "$PID" ] && kill $PID + [ -n "$PID" ] && kill $PID } restart() { diff --git a/net/ntpclient/Makefile b/net/ntpclient/Makefile index dd8e44fe76..1da8e574c9 100644 --- a/net/ntpclient/Makefile +++ b/net/ntpclient/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ntpclient PKG_VERSION:=2003_194 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/ @@ -35,7 +35,7 @@ endef MAKE_FLAGS += \ all adjtimex -define Package/ntpclient/install +define Package/ntpclient/install $(INSTALL_DIR) $(1)/etc/hotplug.d/iface $(INSTALL_DATA) ./files/ntpclient.hotplug $(1)/etc/hotplug.d/iface/20-ntpclient $(INSTALL_DIR) $(1)/etc/config diff --git a/net/ntpclient/files/ntpclient.config b/net/ntpclient/files/ntpclient.config index 8e2717d6e1..c79d07ace0 100644 --- a/net/ntpclient/files/ntpclient.config +++ b/net/ntpclient/files/ntpclient.config @@ -1,9 +1,9 @@ config ntpclient - option hostname 'pool.ntp.org' + option hostname '0.openwrt.pool.ntp.org' option port '123' option count '1' config ntpclient - option hostname 'ntp.ubuntu.com' + option hostname '1.openwrt.pool.ntp.org' option port '123' option count '1' diff --git a/net/ntpclient/files/ntpclient.hotplug b/net/ntpclient/files/ntpclient.hotplug index 631d65f568..2abb0361fc 100644 --- a/net/ntpclient/files/ntpclient.hotplug +++ b/net/ntpclient/files/ntpclient.hotplug @@ -13,7 +13,7 @@ config_cb() { ntpclient) config_get hostname $cfg hostname config_get port $cfg port - config_get count $cfg count + config_get count $cfg count [ "$DONE" = "1" ] && exit 0 ps | grep 'bin/[n]tpclient' >&- || { diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile index 62995d06a8..5919a7a176 100644 --- a/net/ntpd/Makefile +++ b/net/ntpd/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ntp PKG_VERSION:=4.2.4p4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ diff --git a/net/ntpd/files/ntp.conf b/net/ntpd/files/ntp.conf index 9b76eb7c5c..b810305027 100644 --- a/net/ntpd/files/ntp.conf +++ b/net/ntpd/files/ntp.conf @@ -9,10 +9,10 @@ restrict 127.0.0.1 driftfile /tmp/ntp.drift -server 0.pool.ntp.org iburst -server 1.pool.ntp.org iburst -server 2.pool.ntp.org iburst -server 3.pool.ntp.org iburst +server 0.openwrt.pool.ntp.org iburst +server 1.openwrt.pool.ntp.org iburst +server 2.openwrt.pool.ntp.org iburst +server 3.openwrt.pool.ntp.org iburst # GPS(NMEA)+PPS diff --git a/net/ntpd/files/ntpd.init b/net/ntpd/files/ntpd.init index e7ded5cd6e..c966aab63c 100644 --- a/net/ntpd/files/ntpd.init +++ b/net/ntpd/files/ntpd.init @@ -3,17 +3,17 @@ START=60 -STEP_SERVERS="pool.ntp.org pool.ntp.org pool.ntp.org" -PIDFILE="/var/run/ntpd.pid" +STEP_SERVERS="0.openwrt.pool.ntp.org 1.openwrt.pool.ntp.org 2.openwrt.pool.ntp.org" +PIDFILE="/var/run/ntpd.pid" TIMEOUT="2" # in seconds start() { # ln -sf /dev/ttyS0 /dev/gps0 # /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf - stop + stop for s in $STEP_SERVERS ; do /usr/sbin/ntpdate -s -b -u -t "$TIMEOUT" "$s" && break - done + done /usr/sbin/ntpd -g -p $PIDFILE } diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile index 4b86d59f6d..1629957f8c 100644 --- a/net/openntpd/Makefile +++ b/net/openntpd/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openntpd PKG_VERSION:=3.9p1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/ \ diff --git a/net/openntpd/files/ntpd.conf b/net/openntpd/files/ntpd.conf index 6993b8eba2..173900a301 100644 --- a/net/openntpd/files/ntpd.conf +++ b/net/openntpd/files/ntpd.conf @@ -1,3 +1,6 @@ # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers -servers pool.ntp.org +servers 0.openwrt.pool.ntp.org +servers 1.openwrt.pool.ntp.org +servers 2.openwrt.pool.ntp.org +servers 3.openwrt.pool.ntp.org diff --git a/net/samba/files/smbd.config b/net/samba/files/smbd.config index 6993b8eba2..583d21b81d 100644 --- a/net/samba/files/smbd.config +++ b/net/samba/files/smbd.config @@ -1,3 +1,3 @@ # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers -servers pool.ntp.org +servers 0.openwrt.pool.ntp.org -- 2.30.2