bus-util: improve logging when we can't connect to the bus
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Dec 2020 15:36:00 +0000 (16:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 15 Dec 2020 17:01:23 +0000 (18:01 +0100)
commit1ecb46724cae151606bc825f0e39f14d4dfe1a0e
treeb2789d3f88e09a0c741f6439153abb086be45868
parentcedfd142dea105b37223ad24d784494bfae83dc5
bus-util: improve logging when we can't connect to the bus

Previously, we'd already have explicit logging for the case where
$XDG_RUNTIME_DIR is not set. Let's also add some explicit logging for
the EPERM/ACCESS case. Let's also in both cases suggest the
--machine=<user>@.host syntax.

And while we are at it, let's remove side-effects from the macro.

By checking for both the EPERM/EACCES case and the $XDG_RUNTIME_DIR case
we will now catch both the cases where people use "su" to issue a
"systemctl --user" operation, and those where they (more correctly, but
still not good enough) call "su -".

Fixes: #17901
src/shared/bus-util.h