varlink: also honour new env var $SYSTEMD_VARLINK_LISTEN in varlink_server_listen_auto()

varlink_server_listen_auto() is supposed to be the one-stop solution for
turning simple command line tools into IPC services. They aren't easy to
test/debug however, since you have to invoke them through a service
manager.

Let's make this easier: if the SYSTEMD_VARLINK_LISTEN env var is set,
let's listen on the socket specified therein. This makes things easier
to gdb: just run the service from the cmdline.
This commit is contained in:
Lennart Poettering
2024-01-16 13:45:35 +01:00
parent 1752a8ee33
commit 4a6fe5f05e
2 changed files with 17 additions and 0 deletions
+5
View File
@@ -616,3 +616,8 @@ Tools using the Varlink protocol (such as `varlinkctl`) or sd-bus (such as
* `$SYSTEMD_SSH` – the ssh binary to invoke when the `ssh:` transport is
used. May be a filename (which is searched for in `$PATH`) or absolute path.
* `$SYSTEMD_VARLINK_LISTEN` – interpreted by some tools that provide a Varlink
service. Takes a file system path: if specified the tool will listen on an
`AF_UNIX` stream socket on the specified path in addition to whatever else it
would listen on.