nordvpn icon indicating copy to clipboard operation
nordvpn copied to clipboard

add support for openvpn-update-systemd-resolved

Open pedros opened this issue 5 years ago • 1 comments

This patch adds support for systemd-resolved (available as a package from AUR).

pedros avatar Oct 07 '18 16:10 pedros

Hi,

Thank you for your submission. I honestly do not really understand how this script is supposed to work and would appreciate some background.

However, I just gave it a try and it is not working on my end:

● openvpn-client@nordvpn_us1250_tcp.service - OpenVPN tunnel for nordvpn_us1250_tcp
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-10-13 10:00:44 EDT; 34s ago
     Docs: man:openvpn(8)
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
           https://community.openvpn.net/openvpn/wiki/HOWTO
  Process: 4807 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config nordvpn_us1250_tcp.conf (code=exited, status=1/FAILURE)
 Main PID: 4807 (code=exited, status=1/FAILURE)
   Status: "Pre-connection initialization successful"

Oct 13 10:00:44 fukurou openvpn[4807]: <14>Oct 13 10:00:44 updown: Link 'tun0' coming up
Oct 13 10:00:44 fukurou openvpn[4807]: <14>Oct 13 10:00:44 updown: Adding IPv4 DNS Server 103.86.96.100
Oct 13 10:00:44 fukurou openvpn[4807]: <14>Oct 13 10:00:44 updown: Adding IPv4 DNS Server 103.86.99.100
Oct 13 10:00:44 fukurou openvpn[4807]: <14>Oct 13 10:00:44 updown: SetLinkDNS(6 2 2 4 103 86 96 100 2 4 103 86 99 100)
Oct 13 10:00:44 fukurou openvpn[4807]: Unit dbus-org.freedesktop.resolve1.service not found.
Oct 13 10:00:44 fukurou openvpn[4807]: <8>Oct 13 10:00:44 updown: 'busctl' exited with status 1
Oct 13 10:00:44 fukurou openvpn[4807]: WARNING: Failed running command (--up/--down): external program exited with error status: 1
Oct 13 10:00:44 fukurou openvpn[4807]: Exiting due to fatal error
Oct 13 10:00:44 fukurou systemd[1]: openvpn-client@nordvpn_us1250_tcp.service: Main process exited, code=exited, status=1/FAILURE
Oct 13 10:00:44 fukurou systemd[1]: openvpn-client@nordvpn_us1250_tcp.service: Failed with result 'exit-code'.

And then, a second issue, which is not really related to your patch but it happens that the primary audience of this script is archlinux on which the package builder has openvpn-update-resolv-conf-git as a strict dependency. For this reason, even though you install openvpn-update-systemd-resolved, it will still use openvpn-update-resolv-conf first.

Make sure your don't have vpnfailsafe installed and perhaps apply this patch:

diff --git a/src/nordvpn b/src/nordvpn
index a31507e..25ddd89 100755
--- a/src/nordvpn
+++ b/src/nordvpn
@@ -311,8 +311,8 @@ case $command in
         test -z "$service" || $0 stop
         if [ -x /etc/openvpn/vpnfailsafe.sh ]; then
             ln -fs /etc/openvpn/vpnfailsafe.sh $updown
-        elif [ -x /etc/openvpn/update-resolv-conf ]; then
-            ln -fs /etc/openvpn/update-resolv-conf $updown
+#        elif [ -x /etc/openvpn/update-resolv-conf ]; then
+#            ln -fs /etc/openvpn/update-resolv-conf $updown
         elif [ -x /etc/openvpn/scripts/update-systemd-resolved ]; then
             ln -fs /etc/openvpn/scripts/update-systemd-resolved $updown
         else

Then run sudo nordvpn -v start to make sure your updown script is effectively called.

nstinus avatar Oct 13 '18 14:10 nstinus