jonathanio / update-systemd-resolved

Helper script for OpenVPN to directly update the DNS settings of a link through systemd-resolved via DBus.
Other
765 stars 94 forks source link

ubuntu yammy patch #96

Closed hboetes closed 1 year ago

hboetes commented 2 years ago

This is straight from the ubuntu yammy package patch. Of course they never reported that to you. :-(

diff --git a/update-systemd-resolved b/update-systemd-resolved
index 1452e1a..4c63bc7 100755
--- a/update-systemd-resolved
+++ b/update-systemd-resolved
@@ -421,7 +421,7 @@ main() {

     "$script_type" "$link" "$if_index" "$@" || return 1
     # Flush the DNS cache
-    systemd-resolve --flush-caches
+    resolvectl flush-caches
   fi
 }
hboetes commented 2 years ago

And another thing. Please consider installing the script somewhere else, /usr/libexec comes to mind.

Another user called me with the same problem, after I fixed the problem by installing the official package, and this is what I found:

root@ae9notebook /etc/openvpn # l
total 72K
drwxr-xr-x   4 root root 4.0K Feb 15 12:14 .
drwxr-xr-x 188 root root  12K Feb 17 10:26 ..
-r--------   1 root root  11K Jan 25 13:47 ae9notebook.ovpn
drwxr-xr-x   2 root root 4.0K Nov 18 15:05 client
-rwxr-xr-x   1 root root   89 Jan 25 13:47 client.down
-rwxr-xr-x   1 root root  246 Jan 25 13:47 client.up
drwxr-xr-x   2 root root 4.0K Nov 18 15:05 server
-rwxr-xr-x   1 root root 1.5K Nov 18 15:05 update-resolv-conf
-rwxr-xr-x   1 root root  12K Jan 25 13:47 update-systemd-resolved
-rwxr-xr-x   1 root root  12K Jan 20  2021 update-systemd-resolved.dpkg-dist
root@ae9notebook /etc/openvpn # diff -u update-systemd-resolved update-systemd-resolved.dpkg-dist 
--- update-systemd-resolved 2022-01-25 13:47:25.462572234 +0100
+++ update-systemd-resolved.dpkg-dist   2021-01-20 19:46:12.000000000 +0100
@@ -421,7 +421,7 @@

     "$script_type" "$link" "$if_index" "$@" || return 1
     # Flush the DNS cache
-    systemd-resolve --flush-caches
+    resolvectl flush-caches
   fi
 }

root@ae9notebook /etc/openvpn # cp update-systemd-resolved.dpkg-dist update-systemd-resolved
cp: overwrite 'update-systemd-resolved'? y

That's right, because the script is stored in /etc it's considered a settings file and changes/fixes won't get applied. :-(

tomeon commented 1 year ago

Thanks for your report. The issues you mentioned should be solved via #99 and #106.