diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 6c65e64a2e..d6f5c56c2a 100644 --- a/src/main.c +++ b/src/main.c @@ -1060,8 +1060,10 @@ int main(int argc, char *argv[]) { 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); - } else if (target->meta.load_state != UNIT_LOADED) + } else if (target->meta.load_state == UNIT_ERROR) log_error("Failed to load default target: %s", strerror(-target->meta.load_error)); + else if (target->meta.load_state == UNIT_BANNED) + log_error("Default target banned."); if (!target || target->meta.load_state != UNIT_LOADED) { log_info("Trying to load rescue target..."); @@ -1070,12 +1072,17 @@ int main(int argc, char *argv[]) { log_error("Failed to load rescue target: %s", bus_error(&error, r)); dbus_error_free(&error); goto finish; - } else if (target->meta.load_state != UNIT_LOADED) { + } else if (target->meta.load_state == UNIT_ERROR) { log_error("Failed to load rescue target: %s", strerror(-target->meta.load_error)); goto finish; + } else if (target->meta.load_state == UNIT_BANNED) { + log_error("Rescue target banned."); + goto finish; } } + assert(target->meta.load_state == UNIT_LOADED); + if (arg_action == ACTION_TEST) { printf("-> By units:\n"); manager_dump_units(m, stdout, "\t"); |