summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Stefanović <stefanx2ovic@gmail.com>2018-11-08 20:07:31 +0100
committerSven Eden <sven.eden@prydeworx.com>2018-11-09 08:28:28 +0100
commit45f85d95ed11f4e85ee8519f8bedfb75d9e5bc73 (patch)
tree5c0393680eb02b624053b85a123f278a3b031d88
parentf6660fc3afb7005079147e797dfa6badc05ae102 (diff)
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 <sven.eden@prydeworx.com>
-rw-r--r--src/shared/bus-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index e3fc1bd..c03fe2b 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;