set_free_free(u->meta.names);
+ condition_free_list(u->meta.conditions);
+
free(u->meta.instance);
free(u);
}
if (u->meta.job_timeout > 0)
fprintf(f, "%s\tJob Timeout: %s\n", prefix, format_timespan(timespan, sizeof(timespan), u->meta.job_timeout));
+ condition_dump_list(u->meta.conditions, f, prefix);
+
for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++) {
Unit *other;
if (!UNIT_VTABLE(u)->start)
return -EBADR;
+ /* If the conditions failed, don't do anything at all */
+ if (!condition_test_list(u->meta.conditions)) {
+ log_debug("Starting of %s requested but condition failed. Ignoring.", u->meta.id);
+ return -EALREADY;
+ }
+
/* We don't suppress calls to ->start() here when we are
* already starting, to allow this request to be used as a
* "hurry up" call, for example when the unit is in some "auto