Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for openvpn-update-systemd-resolved #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pedros
Copy link

@pedros pedros commented Oct 7, 2018

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

@nstinus
Copy link
Owner

nstinus commented Oct 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants