#include "cgroup-util.h"
#include "path-util.h"
#include "audit-fd.h"
+#include "efivars.h"
#include "env-util.h"
/* As soon as 16 units are in our GC queue, make sure to run a gc sweep */
if (!m)
return -ENOMEM;
+#ifdef ENABLE_EFI
+ if (detect_container(NULL) <= 0)
+ efi_get_boot_timestamps(&m->userspace_timestamp, &m->firmware_timestamp, &m->loader_timestamp);
+#endif
+
m->running_as = running_as;
m->name_data_slot = m->conn_data_slot = m->subscribed_data_slot = -1;
m->exit_code = _MANAGER_EXIT_CODE_INVALID;
goto fail;
/* Try to connect to the busses, if possible. */
- r = bus_init(m, running_as != SYSTEMD_SYSTEM);
- if (r < 0)
- goto fail;
+ if ((running_as == SYSTEMD_USER && getenv("DBUS_SESSION_BUS_ADDRESS")) ||
+ running_as == SYSTEMD_SYSTEM) {
+ r = bus_init(m, running_as != SYSTEMD_SYSTEM);
+ if (r < 0)
+ goto fail;
+ } else
+ log_debug("Skipping DBus session bus connection attempt - no DBUS_SESSION_BUS_ADDRESS set...");
m->taint_usr = dir_is_empty("/usr") > 0;
assert(m);
+ dual_timestamp_get(&m->generators_start_timestamp);
manager_run_generators(m);
+ dual_timestamp_get(&m->generators_finish_timestamp);
r = lookup_paths_init(
&m->lookup_paths, m->running_as, true,
m->n_reloading ++;
/* First, enumerate what we can from all config files */
+ dual_timestamp_get(&m->unitsload_start_timestamp);
r = manager_enumerate(m);
+ dual_timestamp_get(&m->unitsload_finish_timestamp);
/* Second, deserialize if there is something to deserialize */
if (serialization) {
}
}
- if ((r = unit_add_name(ret, name)) < 0) {
+ r = unit_add_name(ret, name);
+ if (r < 0) {
unit_free(ret);
return r;
}
remove_generator_dir(m, &m->generator_unit_path_late);
}
+int manager_set_default_environment(Manager *m, char **environment) {
+
+ char **e = NULL;
+ assert(m);
+ e = strv_env_merge(2, m->environment, environment);
+ if (!e)
+ return -ENOMEM;
+ strv_free(m->environment);
+ m->environment = e;
+ return 0;
+}
+
int manager_set_default_controllers(Manager *m, char **controllers) {
char **l;