analyze/run: use bus_open_transport_systemd instead of bus_open_transport

Both systemd-analyze and systemd-run only access org.freedesktop.systemd1
on the bus. This patch allows using systemd-run --user and systemd-analyze
--user even if the user session's bus is not properly integrated with the
systemd user unit.

https://bugs.freedesktop.org/show_bug.cgi?id=79252 and other reports...
This commit is contained in:
Thomas Bächler
2014-05-26 14:21:53 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 000f6e5667
commit 1f89214e6e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1335,7 +1335,7 @@ int main(int argc, char *argv[]) {
if (r <= 0)
goto finish;
r = bus_open_transport(arg_transport, arg_host, arg_user, &bus);
r = bus_open_transport_systemd(arg_transport, arg_host, arg_user, &bus);
if (r < 0) {
log_error("Failed to create bus connection: %s", strerror(-r));
goto finish;
+1 -1
View File
@@ -593,7 +593,7 @@ int main(int argc, char* argv[]) {
arg_description = description;
}
r = bus_open_transport(arg_transport, arg_host, arg_user, &bus);
r = bus_open_transport_systemd(arg_transport, arg_host, arg_user, &bus);
if (r < 0) {
log_error("Failed to create bus connection: %s", strerror(-r));
goto finish;