Package: drbl
Version: 2.32.10-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: resolvectl
Hi,
systemd-resolve has been replaced by the resolvectl tool in systemd v239
(i.e. is available since buster). This is from the systemd release
notes:
* The systemd-resolve tool has been renamed to resolvectl (it also
remains available under the old name, for compatibility), and its
interface is now verb-based, similar in style to the other <xyz>ctl
tools, such as systemctl or loginctl.
systemd-resolve is nowadays merely a symlink pointing at resolvectl and
we'd like to get rid of this compat symlink at some point.
Your package uses the old name like this:
$ grep -E "systemd-resolve\b" -R
scripts/bin/drbl-get-dnsserver: # Ubuntu >= 17.10 or Debian >= 9, use
"systemd-resolve --status"
scripts/bin/drbl-get-dnsserver: # Results of systemd-resolve --status, example:
scripts/bin/drbl-get-dnsserver: nameserver_sys="$(LC_ALL=C systemd-resolve
--status 2>/dev/null | sed -r -n '/DNS
Servers:/,/(^$|^[[:print:]]*:[[:space:]]+.*)/p' | sed -r -e "s/DNS
Servers://g")"
Attached is a patch which uses resolvectl instead.
Please review and consider applying it in your next upload.
It would be great if you can make this upload before the bullseye
release, so we can safely drop the symlink in bullseye+1.
Regards,
Michael
diff --git a/scripts/bin/drbl-get-dnsserver b/scripts/bin/drbl-get-dnsserver
index dedf17b..da31f48 100755
--- a/scripts/bin/drbl-get-dnsserver
+++ b/scripts/bin/drbl-get-dnsserver
@@ -31,9 +31,9 @@ done
nameserver_sys="$(LC_ALL=C grep -Ew "^nameserver" $DNS_sys | awk -F" " '{print
$2}')"
if [ -z "$nameserver_sys" -o -n "$(echo "$nameserver_sys" | grep -E
"^127\..*")" ]; then
# On Ubuntu, dnsmasq with network-manager, the result might 127.0.0.1. We
use nm-tool to get the real one
- # Ubuntu >= 17.10 or Debian >= 9, use "systemd-resolve --status"
+ # Ubuntu >= 18.10 or Debian >= 10, use "resolvectl status"
# Ubuntu <= 14.04, use "nmcli dev list", while > 14.04, "nmcli dev show".
- # Results of systemd-resolve --status, example:
+ # Results of resolvectl status, example:
# DNS Servers: 8.8.8.8
# 8.8.4.4
# or
@@ -41,7 +41,7 @@ if [ -z "$nameserver_sys" -o -n "$(echo "$nameserver_sys" |
grep -E "^127\..*")"
# 8.8.4.4
# 168.95.1.1
# DNSSEC NTA: 10.in-addr.arpa
- nameserver_sys="$(LC_ALL=C systemd-resolve --status 2>/dev/null | sed -r -n
'/DNS Servers:/,/(^$|^[[:print:]]*:[[:space:]]+.*)/p' | sed -r -e "s/DNS
Servers://g")"
+ nameserver_sys="$(LC_ALL=C resolvectl status 2>/dev/null | sed -r -n '/DNS
Servers:/,/(^$|^[[:print:]]*:[[:space:]]+.*)/p' | sed -r -e "s/DNS
Servers://g")"
# Decide the last line if it's the IP address.
last_line="$(LC_ALL=C echo "$nameserver_sys" | tail -n 1 | grep -E
"^[[:print:]]*:[[:space:]]+.*$")"
if [ -n "$last_line" ]; then