X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmain.c;h=3124b7644e7bb8cbe9417b18e32f2962f5867514;hb=1e3ad081efda42dd1cc737ce7e98be8889c78340;hp=7e3374410c1e26e488896a5f149ff3743d14e37e;hpb=e015090f32dc35360637c5d8f2920654615b2439;p=elogind.git diff --git a/src/main.c b/src/main.c index 7e3374410..3124b7644 100644 --- a/src/main.c +++ b/src/main.c @@ -43,6 +43,7 @@ #include "fdset.h" #include "special.h" #include "conf-parser.h" +#include "bus-errors.h" static enum { ACTION_RUN, @@ -426,7 +427,7 @@ static int config_parse_cpu_affinity( assert(lvalue); assert(rvalue); - FOREACH_WORD(w, l, rvalue, state) { + FOREACH_WORD_QUOTED(w, l, rvalue, state) { char *t; int r; unsigned cpu; @@ -929,7 +930,7 @@ int main(int argc, char *argv[]) { if (getpid() == 1) install_crash_handler(); - log_debug(PACKAGE_STRING " running in %s mode.", manager_running_as_to_string(arg_running_as)); + log_info(PACKAGE_STRING " running in %s mode.", manager_running_as_to_string(arg_running_as)); if (arg_running_as == MANAGER_SYSTEM && !serialization) { if (arg_show_status) @@ -963,14 +964,20 @@ int main(int argc, char *argv[]) { fclose(serialization); serialization = NULL; } else { + DBusError error; + + dbus_error_init(&error); + log_debug("Activating default unit: %s", arg_default_unit); - if ((r = manager_load_unit(m, arg_default_unit, NULL, &target)) < 0) { - log_error("Failed to load default target: %s", strerror(-r)); + if ((r = manager_load_unit(m, arg_default_unit, NULL, &error, &target)) < 0) { + log_error("Failed to load default target: %s", bus_error(&error, r)); + dbus_error_free(&error); log_info("Trying to load rescue target..."); - if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &target)) < 0) { - log_error("Failed to load rescue target: %s", strerror(-r)); + if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &error, &target)) < 0) { + log_error("Failed to load rescue target: %s", bus_error(&error, r)); + dbus_error_free(&error); goto finish; } } @@ -980,8 +987,9 @@ int main(int argc, char *argv[]) { manager_dump_units(m, stdout, "\t"); } - if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &job)) < 0) { - log_error("Failed to start default target: %s", strerror(-r)); + if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, &job)) < 0) { + log_error("Failed to start default target: %s", bus_error(&error, r)); + dbus_error_free(&error); goto finish; }