Fixing ntpd time syncing problem
PATCH 1/1 Fixing ntpd time syncing problem
Add ntp.conf file to make ntpd syncing.
Starting ntpd daemon with -g to sync time also with big offsets. Removes the use of deprecated ntpdate command for initial time sync.
--- package/ntp/S49ntp | 8 +------- package/ntp/ntp.mk | 1 + package/ntp/ntpd.etc.conf | 8 ++++++++ package/ntp/ntpd.etc.default | 7 ------- 4 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 package/ntp/ntpd.etc.conf
package/ntp/S49ntp +1 -7
@@ -20,14 +20,8 @@ fi case "$1" in start) - if [ -x $NTPDATE_BIN ] ; then - echo -n "Getting initial time via ntp" - $NTPDATE_BIN $NTPDATE_OPTS $NTPSERVERS > /dev/null 2>&1 - echo "." - fi - echo -n "Starting $DESC: $NAME" - start-stop-daemon -S -q -x $DAEMON + start-stop-daemon -S -q -x $DAEMON -- -g echo "." ;; stop) echo -n "Stopping $DESC: $NAME"
package/ntp/ntp.mk +1 -0
@@ -52,6 +52,7 @@ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj define NTP_INSTALL_TARGET_CMDS $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd) test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf @if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \ $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/default ; \ $(INSTALL) -m 644 package/ntp/ntpd.etc.default $(TARGET_DIR)/etc/default/ntpd ; \
package/ntp/ntpd.etc.conf new file +8 -0
@@ -0,0 +1,8 @@ +server 0.pool.ntp.org iburst +server 1.pool.ntp.org iburst + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery + +restrict 127.0.0.1 +restrict -6 ::1
package/ntp/ntpd.etc.default +0 -7
@@ -1,9 +1,2 @@ -# NTP Servers to use for ntpdate -NTPSERVERS="pool.ntp.org" - -# Get initial time via ntpdate? -NTPDATE=no -NTPDATE_OPTS="-t 5" - # Start the ntp daemon? NTPD=yes
Signature · 1 line
2.0.0
PATCH 1/1 Fixing ntpd time syncing problem
Quoted 5 lines · Angelo Compagnucci
Add ntp.conf file to make ntpd syncing.
Starting ntpd daemon with -g to sync time also with big offsets. Removes the use of deprecated ntpdate command for initial time sync.Signed-off-by Angelo Compagnucci <[email protected]>
The "restrict -6" configuration directives give non-critical errors when building with a non-IPv6 toolchain, it's not nice but it works anyway, so:
PATCH 1/1 Fixing ntpd time syncing problem
In reply to Angelo CompagnucciQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
Add ntp.conf file to make ntpd syncing.
Starting ntpd daemon with -g to sync time also with big offsets. Removes the use of deprecated ntpdate command for initial time sync.Signed-off-by Angelo Compagnucci <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard