Feature detection¶
Source · systemd v257+ · Unprivileged
A support matrix for the host's systemd, built from the two checks every
program that spans systemd releases needs: is the service there?
(Dial → varlink.ErrUnsupported) and does it have this method?
(Client.Supports).
Run it¶
Output (real, a systemd v255 host: below the Varlink floor)
FEATURE METHOD STATUS
Describe the service manager Describe ✗ service not available (fall back to D-Bus)
List units over Varlink (v258+) List ✗ service not available (fall back to D-Bus)
Change unit properties (v260+) SetProperties ✗ service not available (fall back to D-Bus)
Resolve host names ResolveHostname ✗ service not available (fall back to D-Bus)
Browse DNS-SD services BrowseServices ✗ service not available (fall back to D-Bus)
Dump DNS configuration DumpDNSConfiguration ✗ service not available (fall back to D-Bus)
Describe the host Describe ✗ service not available (fall back to D-Bus)
List machines List ✗ service not available (fall back to D-Bus)
Output (illustrative, a systemd v258 host)
FEATURE METHOD STATUS
Describe the service manager Describe ✓ supported
List units over Varlink (v258+) List ✓ supported
Change unit properties (v260+) SetProperties ✗ method missing on this systemd
Resolve host names ResolveHostname ✓ supported
Browse DNS-SD services BrowseServices ✓ supported
Dump DNS configuration DumpDNSConfiguration ✗ method missing on this systemd
Describe the host Describe ✓ supported
List machines List ✓ supported
The code¶
How it works¶
- Two kinds of "no". A missing socket means the whole service is
unavailable (too old, or not running);
Supportsreturningfalsemeans the service runs but predates the method. - Any client works. Every generated
ClienthasSupportsandClose, so a two-method interface plus a small genericwraplets one table probe many packages. - Imports
latestso it can name every method;Supportsasks the live service, so the answer reflects the host, not the bindings. Supportscosts one round trip; check once at startup.