From 45f85d95ed11f4e85ee8519f8bedfb75d9e5bc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Stefanovi=C4=87?= Date: Thu, 8 Nov 2018 20:07:31 +0100 Subject: bus-util: Remove invalid check against systemd providing PID 1. (#93) This check always returns error -EHOSTDOWN, because sd_booted() always returns 0. This will fix loginctl execution error, returned from the login/loginctl.c:main(). Before enabling user buses, this check was bypassed by re-routing attempts to connect to user buses to the system bus. Bug: #87 Bug: #93 Closes: #93 Sigend-off-by: Sven Eden --- src/shared/bus-util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index e3fc1bd57..c03fe2b46 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1302,12 +1302,14 @@ int bus_connect_transport(BusTransport transport, const char *host, bool user, s if (user) r = sd_bus_default_user(&bus); else { +#if 0 /// elogind is never used with systemd. Avoid useless check. if (sd_booted() <= 0) { /* Print a friendly message when the local system is actually not running systemd as PID 1. */ log_error("System has not been booted with systemd as init system (PID 1). Can't operate."); return -EHOSTDOWN; } +#endif // 0 r = sd_bus_default_system(&bus); } break; @@ -1352,12 +1354,14 @@ int bus_connect_transport_systemd(BusTransport transport, const char *host, bool if (user) r = bus_connect_user_systemd(bus); else { +#if 0 /// elogind is never used with systemd. Avoid useless check. if (sd_booted() <= 0) { /* Print a friendly message when the local system is actually not running systemd as PID 1. */ log_error("System has not been booted with systemd as init system (PID 1). Can't operate."); return -EHOSTDOWN; } +#endif // 0 r = bus_connect_system_systemd(bus); } break; -- cgit v1.2.3