Bugs:
-* Don't try to connect to dbus during early boot
-
* sometimes processes seem to remain when we kill a service
http://lists.fedoraproject.org/pipermail/devel/2011-January/147559.html
return r;
}
-int bus_init(Manager *m) {
+int bus_init(Manager *m, bool try_bus_connect) {
int r;
if (set_ensure_allocated(&m->bus_connections, trivial_hash_func, trivial_compare_func) < 0 ||
return -ENOMEM;
}
- if ((r = bus_init_system(m)) < 0 ||
- (r = bus_init_api(m)) < 0 ||
- (r = bus_init_private(m)) < 0)
+ if (try_bus_connect) {
+ if ((r = bus_init_system(m)) < 0 ||
+ (r = bus_init_api(m)) < 0)
+ return r;
+ }
+
+ if ((r = bus_init_private(m)) < 0)
return r;
return 0;
" </method>\n" \
"</interface>\n"
-int bus_init(Manager *m);
+int bus_init(Manager *m, bool try_bus_connect);
void bus_done(Manager *m);
unsigned bus_dispatch(Manager *m);
goto fail;
/* Try to connect to the busses, if possible. */
- if ((r = bus_init(m)) < 0)
+ if ((r = bus_init(m, running_as != MANAGER_SYSTEM)) < 0)
goto fail;
#ifdef HAVE_AUDIT
if (!u || UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u))) {
log_info("Trying to reconnect to bus...");
- bus_init(m);
+ bus_init(m, true);
}
if (!u || !UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u))) {
/* The bus just might have become available,
* hence try to connect to it, if we aren't
* yet connected. */
- bus_init(u->meta.manager);
+ bus_init(u->meta.manager, true);
if (unit_has_name(u, SPECIAL_SYSLOG_SERVICE))
/* The syslog daemon just might have become