From 05478072cd8faee443ceadb1ebfac11057bd6dc1 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Tue, 15 Aug 2017 20:20:16 +0200 Subject: [PATCH] unbound/ntp: move not working DNS fallback from ntp to unbound initskript the ntp initskript will only run at first connection try. If this fails and the connection can established later DNS will not work if the clock is too far away. Signed-off-by: Arne Fitzenreiter --- config/rootfiles/core/113/filelists/files | 2 ++ src/initscripts/system/ntp | 8 -------- src/initscripts/system/unbound | 10 ++++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/config/rootfiles/core/113/filelists/files b/config/rootfiles/core/113/filelists/files index 168c7d188..ceed6de2d 100644 --- a/config/rootfiles/core/113/filelists/files +++ b/config/rootfiles/core/113/filelists/files @@ -1,3 +1,5 @@ etc/system-release etc/issue +etc/rc.d/init.d/ntp +etc/rc.d/init.d/unbound var/ipfire/langs diff --git a/src/initscripts/system/ntp b/src/initscripts/system/ntp index 079392790..d411ba18d 100644 --- a/src/initscripts/system/ntp +++ b/src/initscripts/system/ntp @@ -27,14 +27,6 @@ case "$1" in fi if [ -e /var/ipfire/red/active ]; then boot_mesg "" - - host ping.ipfire.org > /dev/null 2>&1 - if [ "${?}" != "0" ]; then - boot_mesg "DNS not work ... init with ntp.ipfire.org at 81.3.27.46 ..." - loadproc /usr/local/bin/settime 81.3.27.46 - boot_mesg "Setting time on boot..." - fi - loadproc /usr/local/bin/settime $(cat /var/ipfire/time/settime.conf) else boot_mesg " ERROR! Not online!" diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound index 7437d93b8..3002f4800 100644 --- a/src/initscripts/system/unbound +++ b/src/initscripts/system/unbound @@ -484,6 +484,16 @@ case "$1" in # Update hosts update_hosts + + # If DNS still not work try to init ntp with + # hardcoded ntp.ipfire.org (81.3.27.46) + if [ -e /var/ipfire/red/active ]; then + host 0.ipfire.pool.ntp.org > /dev/null 2>&1 + if [ "${?}" != "0" ]; then + boot_mesg "DNS still not work ... init time with ntp.ipfire.org at 81.3.27.46 ..." + loadproc /usr/local/bin/settime 81.3.27.46 + fi + fi ;; stop)