|
From: <abe...@us...> - 2016-12-01 21:30:59
|
Revision: 8005
http://sourceforge.net/p/astlinux/code/8005
Author: abelbeck
Date: 2016-12-01 21:30:56 +0000 (Thu, 01 Dec 2016)
Log Message:
-----------
chrony, only use the first 'server' or 'pool' entry to first set the time
Modified Paths:
--------------
branches/1.0/package/chrony/ntpd.init
Modified: branches/1.0/package/chrony/ntpd.init
===================================================================
--- branches/1.0/package/chrony/ntpd.init 2016-12-01 18:19:01 UTC (rev 8004)
+++ branches/1.0/package/chrony/ntpd.init 2016-12-01 21:30:56 UTC (rev 8005)
@@ -63,18 +63,25 @@
}
start () {
+ local first
if [ -f /etc/chrony.conf ]; then
# Set the clock (large change)
- echo "Setting local time/date..."
- if chronyd -q; then
- if [ -r /dev/rtc ]; then
- hwclock -wu --noadjfile 2>/dev/null
+ first="$(awk '/^server / { print $2; nextfile; }' /etc/chrony.conf)"
+ if [ -z "$first" ]; then
+ first="$(awk '/^pool / { print $2; nextfile; }' /etc/chrony.conf)"
+ fi
+ if [ -n "$first" ]; then
+ echo "Setting local system time using '$first'..."
+ if chronyd -q "server $first iburst"; then
+ if [ -r /dev/rtc ]; then
+ hwclock -wu --noadjfile 2>/dev/null
+ fi
fi
+ rm -f $PIDFILE
+ sleep 1
fi
- rm -f $PIDFILE
- sleep 1
# Maintain the clock (small changes)
echo "Starting NTP Daemon (chronyd)..."
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|