Package: ntpdate
Version: 1:4.2.8p9+dfsg-2.1
Severity: normal
Tags: patch

--- Please enter the report below this line. ---
With ntp installed and /etc/default/ntpdate entry:
NTPDATE_USE_NTP_CONF=yes

The command: /usr/sbin/ntpdate-debian -v -q
gives:       no servers can be used, exiting

This is because ntpdate-debian is looking for server entries with:
sed -rne 's/^(servers?|peer)...

The attached patch adds pool to correctly pick up the pool entries
sed -rne 's/^(servers?|peer|pool)...

And a correct result from:
/usr/sbin/ntpdate-debian -v -q


--- System information. ---
Architecture: Kernel:       Linux 4.9.0-1-amd64

Debian Release: 9.0
  990 testing         httpredir.debian.org   500 unstable
httpredir.debian.org   500 stable-updates  httpredir.debian.org   500
stable          security.debian.org   500 stable
httpredir.debian.org
--- Package information. ---
Depends        (Version) | Installed
========================-+-===========
netbase                  | 5.4
libc6          (>= 2.17) | libssl1.1     (>= 1.1.0) |

Package's Recommends field is empty.

Package's Suggests field is empty.
diff --git a/debian/ntpdate-debian b/debian/ntpdate-debian
index e76d5ab..d9d1792 100644
--- a/debian/ntpdate-debian
+++ b/debian/ntpdate-debian
@@ -14,7 +14,7 @@ if [ "$NTPDATE_USE_NTP_CONF" = yes ]; then
 		fi
 	done
 	if [ -n "$file" ]; then
-		NTPSERVERS=$(sed -rne 's/^(servers?|peer)[[:space:]]+(-[46][[:space:]]+)?([-_.:[:alnum:]]+).*$/\3/p' "$file" | grep -v '^127\.127\.') || [ $? -le 1 ]
+		NTPSERVERS=$(sed -rne 's/^(servers?|peer|pool)[[:space:]]+(-[46][[:space:]]+)?([-_.:[:alnum:]]+).*$/\3/p' "$file" | grep -v '^127\.127\.') || [ $? -le 1 ]
 	fi
 fi
 

Reply via email to