manager: when reexecuting try to connect to bus only when dbus.service is around (#6773)
Trying to connect otherwise is pointless, because if socket isn't around we won't connect. However, when dbus.socket is present we attempt to connect. That attempt can't succeed because we are then supposed to activate dbus.service as a response to connection from us. This results in deadlock. Fixes #6303
This commit is contained in:
parent
e3695e499a
commit
5463fa0a88
|
@ -921,15 +921,19 @@ static int manager_setup_user_lookup_fd(Manager *m) {
|
|||
|
||||
static int manager_connect_bus(Manager *m, bool reexecuting) {
|
||||
bool try_bus_connect;
|
||||
Unit *u = NULL;
|
||||
|
||||
assert(m);
|
||||
|
||||
if (m->test_run)
|
||||
return 0;
|
||||
|
||||
u = manager_get_unit(m, SPECIAL_DBUS_SERVICE);
|
||||
|
||||
try_bus_connect =
|
||||
reexecuting ||
|
||||
(MANAGER_IS_USER(m) && getenv("DBUS_SESSION_BUS_ADDRESS"));
|
||||
(u && UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u))) &&
|
||||
(reexecuting ||
|
||||
(MANAGER_IS_USER(m) && getenv("DBUS_SESSION_BUS_ADDRESS")));
|
||||
|
||||
/* Try to connect to the buses, if possible. */
|
||||
return bus_init(m, try_bus_connect);
|
||||
|
|
Loading…
Reference in a new issue