summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-12 01:05:35 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-12 01:05:35 +0200
commit8821a00fd5b8cb349bce66816c213573db05ec46 (patch)
tree304b1f153ffd6785ac91d31fbe1080a73d239eb6 /src/manager.c
parent302e27c89ed57f413d2a136fbe66fde32f016aed (diff)
unit: don't show ENOENT configuration file warnings for units that are not essential
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/manager.c b/src/manager.c
index 9684efac8b..3e742f791e 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -1392,9 +1392,15 @@ static int transaction_add_job_and_dependencies(
assert(type < _JOB_TYPE_MAX);
assert(unit);
- if (type != JOB_STOP &&
- unit->meta.load_state != UNIT_LOADED) {
- dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s failed to load. See logs for details.", unit->meta.id);
+ if (unit->meta.load_state != UNIT_LOADED && unit->meta.load_state != UNIT_FAILED) {
+ dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->meta.id);
+ return -EINVAL;
+ }
+
+ if (type != JOB_STOP && unit->meta.load_state == UNIT_FAILED) {
+ dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s failed to load: %s. You might find more information in the logs.",
+ unit->meta.id,
+ strerror(-unit->meta.load_error));
return -EINVAL;
}