manager: always allow stopping of units that failed to load

This commit is contained in:
Lennart Poettering 2010-07-13 20:07:00 +02:00
parent 1d2e23ab72
commit 3dda9fc3a7
1 changed files with 2 additions and 1 deletions

View File

@ -1328,7 +1328,8 @@ static int transaction_add_job_and_dependencies(
assert(type < _JOB_TYPE_MAX); assert(type < _JOB_TYPE_MAX);
assert(unit); assert(unit);
if (unit->meta.load_state != UNIT_LOADED) { 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); dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s failed to load. See logs for details.", unit->meta.id);
return -EINVAL; return -EINVAL;
} }