Skip to content

`busctl' exited with status 1 #12

Closed

Description

@ezhukov

On my Debian system fails with this:
...
<14>Sep 1 22:16:26 update-systemd-resolved[1320]: Adding IPv4 DNS Server 193.181.14.10
<14>Sep 1 22:16:26 update-systemd-resolved[1320]: Adding IPv4 DNS Server 193.181.14.11
<14>Sep 1 22:16:26 update-systemd-resolved[1320]: SetLinkDNS(7 2 2 4 193 181 14 10 2 4 193 181 14 11)
Link tun0 is managed.
<8>Sep 1 22:16:26 update-systemd-resolved[1320]: `busctl' exited with status 1
Thu Sep 1 22:16:26 2016 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Thu Sep 1 22:16:26 2016 Exiting due to fatal error

Activity

  1. jonathanio commented on Sep 1, 2016

    @jonathanio
    Owner

    @ezhukov,

    The call looks correct to me: 7 is the ifindex, 2 array entries, 2 entries in the first slow, IPv4, four octets. There's nothing that appears to be wrong with that setting.

    If you disable the up command, connect, and then run ip link show tun0, the first number is the ifindex. Then run (replacing {ifindex} with the number):

    busctl call org.freedesktop.resolve1 \
      /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager \
      SetLinkDNS 'ia(iay)' {ifindex} 2 2 4 193 181 14 10 2 4 193 181 14 11
    

    and let me know what it says?

    I use it on three different VPNs myself and no issues so far, so I would like to work this out. :)

  2. self-assigned this
    on Sep 1, 2016
  3. ezhukov commented on Sep 1, 2016

    @ezhukov
    Author

    It says:
    Link tun0 is managed.

  4. jonathanio commented on Sep 1, 2016

    @jonathanio
    Owner

    In that case, can you try:

    dbus-send --print-reply --system \
      --type=method_call --dest=org.freedesktop.resolve1 \
      /org/freedesktop/resolve1/link/_{ifindex+30} org.freedesktop.DBus.Properties.GetAll string:''
    

    where {ifindex} is as found before (but make sure you add 30 to the number).

    Additionally, do you have a .network or .netdev file under systemd-networkd which matches tun0?

  5. ezhukov commented on Sep 1, 2016

    @ezhukov
    Author

    Got it!
    I used to have
    [Match]
    Name=wlan0
    [Network]
    DHCP=yes
    in my .network file.
    Recently I removed Name=wlan0 line to let systemd configure all interfaces.
    That was it, after I added it back it worked again.
    Thanks!

  6. jonathanio commented on Sep 1, 2016

    @jonathanio
    Owner

    @ezhukov,

    Brill! Thanks for the report nonetheless and glad we found the issue.

  7. piotr-dobrogost commented on Jan 29, 2017

    @piotr-dobrogost
    Contributor

    I was getting the same error (busctl exited with status 1) but the reason was selinux blocking dbus call with the following entry in journalctl:

    Jan 29 16:32:52 demon audit[846]: USER_AVC pid=846 uid=81 auid=4294967295 ses=4294967295
    subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023  
    msg='avc:  denied  { send_msg } for msgtype=method_call interface=org.freedesktop.resolve1.Manager
    member=SetLinkDNS dest=org.freedesktop.resolve1 spid=30054 tpid=954
    scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:system_r:systemd_resolved_t:s0
    tclass=dbus
    exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
    
  8. jonathanio commented on Jan 30, 2017

    @jonathanio
    Owner

    This is an interesting one as I think that will need to be escalated to the OpenVPN packaging team within CentOS/RHEL. It will be important to allow access to this for the daemon, especially as there has been discussion I believe around getting OpenVPN to update the systemd-resolved.service from within OpenVPN itself.

  9. piotr-dobrogost commented on Jan 30, 2017

    @piotr-dobrogost
    Contributor

    By update the systemd-resolved.service you don't mean updating unit file, do you?
    Do you have a link to this discussion?
    I found issue with selinux blocking dbus calls from --up/--down script raised at https://bugzilla.redhat.com/show_bug.cgi?id=1415155
    Home of openvpn package for Fedora/EPEL – https://apps.fedoraproject.org/packages/openvpn/bugs

  10. jonathanio commented on Jan 30, 2017

    @jonathanio
    Owner

    @piotr-dobrogost,

    Sorry, bad wording on my part: By update systemd-resolved.service I mean via DBus rather than the unit file itself. As for the discussion: https://community.openvpn.net/openvpn/ticket/753. It's more that's it's been flagged and is being considered I suppose as part of further integration within systemd.

  11. khuffmanjr commented on Aug 16, 2017

    @khuffmanjr

    I'm getting the same error. When I try to invoke busctl from above, I get:

    [user@server path]$ busctl call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager SetLinkDNS 'ia(iay)' 6 2 2 4 193 181 14 10 2 4 193 181 14 11 Unknown method 'SetLinkDNS' or interface 'org.freedesktop.resolve1.Manager'.

  12. jonathanio commented on Aug 17, 2017

    @jonathanio
    Owner

    @khuffmanjr,

    That looks like either systemd-resolved.service isn't running, or you do not have a recent-enough version of systemd to provide the DNS interface via DBus. What version of systemd are you running?

  13. khuffmanjr commented on Aug 17, 2017

    @khuffmanjr
  14. 1 remaining item

  15. jonathanio commented on Aug 17, 2017

    @jonathanio
    Owner

    @khuffmanjr,

    Can you run:

    • systemctl --version please and let me know the output - this will confirm the version you are running;
    • systemctl status systemd-resolved.service to check the status of the service; and
    • You imply [user@server path]$ above - only the root user can update the DNS currently. Can you confirm that the openvpn service, and hence the script on connection, are running as root also?
  16. khuffmanjr commented on Aug 17, 2017

    @khuffmanjr

    that was just me blanking out everything for the www.

    [user@serverXYZ .somefolder]$ yum info systemd-resolved
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
     * base: repos-tx.psychz.net
     * epel: pubmirror2.math.uh.edu
     * extras: mirror.oss.ou.edu
     * updates: mirror.dal10.us.leaseweb.net
    Installed Packages
    Name        : systemd-resolved
    Arch        : x86_64
    Version     : 219
    Release     : 30.el7_3.9
    Size        : 1.0 M
    Repo        : installed
    From repo   : updates
    Summary     : Network Name Resolution manager.
    URL         : http://www.freedesktop.org/wiki/Software/systemd
    License     : LGPLv2+
    Description : systemd-resolved is a system service that manages network name resolution.
                : It implements a caching DNS stub resolver and an LLMNR resolver and responder.
    
    
    [user@serverXYZ .somefolder]$ sudo systemctl --version
    systemd 219
    +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN
    
    
    [user@serverXYZ .somefolder]$ sudo systemctl status systemd-resolved
    ● systemd-resolved.service - Network Name Resolution
       Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: disabled)
       Active: active (running) since Thu 2017-08-17 10:21:22 CDT; 29s ago
         Docs: man:systemd-resolved.service(8)
     Main PID: 553 (systemd-resolve)
       Status: "Processing requests..."
       CGroup: /system.slice/systemd-resolved.service
               └─553 /usr/lib/systemd/systemd-resolved
    
    Aug 17 10:21:22 serverXYZ.home.local systemd[1]: Starting Network Name Resolution...
    Aug 17 10:21:22 serverXYZ.home.local systemd-resolved[553]: Using system hostname 'serverXYZ.home.local'.
    Aug 17 10:21:22 serverXYZ.home.local systemd-resolved[553]: Switching to system DNS server 192.168.1.1.
    Aug 17 10:21:22 serverXYZ.home.local systemd[1]: Started Network Name Resolution.
    
    [user@serverXYZ .somefolder]$ sudo openvpn AirVPN_Netherlands_UDP-443.ovpn
    [sudo] password for user:
    Thu Aug 17 10:33:02 2017 OpenVPN 2.4.3 x86_64-redhat-linux-gnu [Fedora EPEL patched] [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jun 21 2017
    Thu Aug 17 10:33:02 2017 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.06
    etc etc etc...
    
    [user@serverXYZ ~]$ ip link show tun0
    12: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 100
        link/none
    
    

    And this - not knowing exactly what privileges are required - I ran with and without sudo with same result:

    [user@serverXYZ ~]$ busctl call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager SetLinkDNS 'ia(iay)' 12 2 2 4 193 181 14 10 2 4 193 181 14 11
    Unknown method 'SetLinkDNS' or interface 'org.freedesktop.resolve1.Manager'.
    

    And, for good measure:

    [user@serverXYZ .somefolder]$ uname -a
    Linux serverXYZ.home.local 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    
    
  17. jonathanio commented on Aug 17, 2017

    @jonathanio
    Owner

    @khuffmanjr,

    I'm afraid you require systemd-229 as a minimum. The DBus interface for systemd-resolved.service was not added until then.

  18. khuffmanjr commented on Aug 17, 2017

    @khuffmanjr

    Yikes, ok. I'll have a look around then. Thanks for the answer and for your work on this project.

  19. jonathanio commented on Aug 17, 2017

    @jonathanio
    Owner

    No problem. Thanks.

  20. khuffmanjr commented on Aug 18, 2017

    @khuffmanjr

    Ok, I'm on Fedora 26 now. I think I'm closer this time, but its not setting DNS. Here is some output from connecting, cat /etc/resolv.conf and nslookup. I'm not getting my DNS server.

    [user@Fedora26 folder]$ sudo openvpn AirVPN_Netherlands_UDP-443.ovpn &
    [1] 17801
    [user@Fedora26 folder]$ Thu Aug 17 19:41:18 2017 OpenVPN 2.4.3 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jun 21 2017
    Thu Aug 17 19:41:18 2017 library versions: OpenSSL 1.0.2j-fips  26 Sep 2016, LZO 2.08
    Thu Aug 17 19:41:18 2017 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
    Thu Aug 17 19:41:18 2017 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
    Thu Aug 17 19:41:18 2017 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
    Thu Aug 17 19:41:18 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]213.152.161.137:443
    Thu Aug 17 19:41:18 2017 Socket Buffers: R=[212992->212992] S=[212992->212992]
    Thu Aug 17 19:41:18 2017 UDP link local: (not bound)
    Thu Aug 17 19:41:18 2017 UDP link remote: [AF_INET]213.152.161.137:443
    Thu Aug 17 19:41:18 2017 TLS: Initial packet from [AF_INET]213.152.161.137:443, sid=0a983fd6 620dabf5
    Thu Aug 17 19:41:19 2017 VERIFY OK: depth=1, C=IT, ST=IT, L=Perugia, O=airvpn.org, CN=airvpn.org CA, [email protected]
    Thu Aug 17 19:41:19 2017 VERIFY KU OK
    Thu Aug 17 19:41:19 2017 Validating certificate extended key usage
    Thu Aug 17 19:41:19 2017 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
    Thu Aug 17 19:41:19 2017 VERIFY EKU OK
    Thu Aug 17 19:41:19 2017 VERIFY OK: depth=0, C=IT, ST=IT, L=Perugia, O=airvpn.org, CN=server, [email protected]
    Thu Aug 17 19:41:19 2017 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
    Thu Aug 17 19:41:19 2017 [server] Peer Connection Initiated with [AF_INET]213.152.161.137:443
    Thu Aug 17 19:41:20 2017 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
    Thu Aug 17 19:41:20 2017 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS XX.XX.XX.XX,comp-lzo no,route-gateway XX.XX.XX.XX,topology subnet,ping 10,ping-restart 60,ifconfig XX.XX.XX.XX 255.255.0.0'
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: timers and/or timeouts modified
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: compression parms modified
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: --ifconfig/up options modified
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: route options modified
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: route-related options modified
    Thu Aug 17 19:41:20 2017 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
    Thu Aug 17 19:41:20 2017 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
    Thu Aug 17 19:41:20 2017 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
    Thu Aug 17 19:41:20 2017 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
    Thu Aug 17 19:41:20 2017 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
    Thu Aug 17 19:41:20 2017 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=ens192 HWADDR=XX:XX:XX:XX:XX:XX
    Thu Aug 17 19:41:20 2017 TUN/TAP device tun0 opened
    Thu Aug 17 19:41:20 2017 TUN/TAP TX queue length set to 100
    Thu Aug 17 19:41:20 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
    Thu Aug 17 19:41:20 2017 /sbin/ip link set dev tun0 up mtu 1500
    Thu Aug 17 19:41:20 2017 /sbin/ip addr add dev tun0 XX.XX.XX.XX/16 broadcast XX.XX.255.255
    Thu Aug 17 19:41:20 2017 /etc/openvpn/scripts/update-systemd-resolved tun0 1500 1558 XX.XX.XX.XX 255.255.0.0 init
    <14>Aug 17 19:41:20 update-systemd-resolved: Link 'tun0' coming up
    <14>Aug 17 19:41:20 update-systemd-resolved: Adding IPv4 DNS Server XX.XX.XX.XX
    <14>Aug 17 19:41:20 update-systemd-resolved: SetLinkDNS(4 1 2 4 XX XX XX XX)
    
    Thu Aug 17 19:41:25 2017 /sbin/ip route add 213.152.161.137/32 via 192.168.1.1
    Thu Aug 17 19:41:25 2017 /sbin/ip route add 0.0.0.0/1 via XX.XX.XX.XX
    Thu Aug 17 19:41:25 2017 /sbin/ip route add 128.0.0.0/1 via XX.XX.XX.XX
    Thu Aug 17 19:41:25 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
    Thu Aug 17 19:41:25 2017 Initialization Sequence Completed
    
    [user@Fedora26 folder]$ cat /etc/resolv.conf
    # Generated by NetworkManager
    search home.local
    nameserver 192.168.1.1
    nameserver 8.8.8.8
    [user@Fedora26 folder]$ nslookup airvpn.org
    Server:         192.168.1.1
    Address:        192.168.1.1#53
    
    Non-authoritative answer:
    Name:   airvpn.org
    Address: 5.196.64.52
    ;; Warning: Message parser reports malformed message packet.
    ;; Got recursion not available from 192.168.1.1, trying next server
    Name:   airvpn.org
    Address: 2001:41d0:a:6034::
    
    

    And I get no output from:

    [user@Fedora26 folder]$ ip link show tun0
    5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 100
        link/none
    [user@Fedora26 folder]$ sudo busctl call org.freedesktop.resolve1 /org/freedesktop/resolve1 org.freedesktop.resolve1.Manager SetLinkDNS 'ia(iay)' 5 2 2 4 193 181 14 10 2 4 193 181 14 11
    
    

    And I should be on a good version of systemd:

    [user@Fedora26 folder]$ sudo systemctl --version
    systemd 233
    +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN default-hierarchy=hybrid
    
    
  21. tomeon commented on Aug 18, 2017

    @tomeon
    Collaborator

    @khuffmanjr -- I might be missing something here, but it seems like your /etc/resolv.conf is being managed by NetworkManager rather than systemd-resolved. If you want to use systemd-resolved, you should ensure that /etc/resolv.conf is a symlink to /usr/lib/systemd/resolv.conf (it might be a different path on your system; I'm on Arch Linux). You can add 192.168.1.1 and 8.8.8.8 to /etc/systemd/resolved.conf as upstream resolvers:

    [Resolve]
    DNS=192.168.1.1 8.8.8.8
    # or if you want to use resolvers configured by systemd-networkd, falling back to these as defaults:
    FallbackDNS=192.168.1.1 8.8.8.8
  22. khuffmanjr commented on Aug 18, 2017

    @khuffmanjr

    well darn. Maybe NetworkManager needs to go - too bad, I was just getting into nmcli. systemd-networkd, here I come.

    Thanks sir.

  23. sasanj commented on Nov 13, 2018

    @sasanj

    The same problem happened to me recently. I checked everything that is mentioned on this page, but still got the Link tun0 is managed. I think, but certainly not sure that /lib/systemd/network/99-default.link is to blame!
    however the solution was to create a file (which I named tun.network) in /etc/systemd/network with the following content

    [Match]
    Name=tun*
    [Link]
    Unmanaged=yes
    

    Restarted systemd-networkd and update-systemd-resolved worked without any more problems.
    This makes senese, since tun devices are mostly created using external programs.

  24. piotr-dobrogost commented on Jan 2, 2019

    @piotr-dobrogost
    Contributor

    Problem with SELinux blocking dbus calls from the script (which I described earlier in this thread) is still present in Fedora 29 with openvpn.x86_64 2.4.6-3.fc29 installed. As https://bugzilla.redhat.com/show_bug.cgi?id=1415155 was closed due to EOL of Fedora 24 I raised this again at https://bugzilla.redhat.com/show_bug.cgi?id=1662909

  25. tomeon commented on Nov 20, 2020

    @tomeon
    Collaborator

    Looks like this might require a Polkit rule; looking into it.

  26. tomeon commented on Nov 20, 2020

    @tomeon
    Collaborator

    Have a basic POC that's working for me on Arch Linux. Put this in a .rules file under /etc/polkit-1/rules.d; e.g., /etc/polkit-1/rules.d/10-update-systemd-resolved.rules:

    /* Allow OpenVPN client services to update systemd-resolved settings */
    
    polkit.addRule(function(action, subject) {
        if (
                subject.user == "openvpn"
            &&  action.id.startsWith("org.freedesktop.resolve1.")
        ) {
            var ns = action.id.split(".");
            var subaction = ns[ns.length - 1];
    
            if (
                    subaction == "set-dns-servers"
                ||  subaction == "set-domains"
                ||  subaction == "set-dnssec"
                ||  subaction == "revert"
            ) {
                return polkit.Result.YES;
            }
        }
    });

    Note that this is just an initial stab at the issue; needs better access control (like checking the name of the unit to make sure it matches openvpn-client@, or something).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions